Sign in Join
Wiki copytemporary

DWARF

English · Suomi

About

DWARF (Debugging With Attributed Record Formats) is a debugging data format. Dwarf is needed when debugging with FpDebug.

Debugging information is generated by the compiler together with the machine code. Debugging information is read by the debugger. Debugging information is a representation of the relationship between the executable program and the original source code. This information is encoded into a pre-defined format and stored alongside the machine code.

The FPC provides the following DWARF-compatible debugging information with command line parameters:

Choosing a DWARF version for Debugging

See Debugger Setup for information which setting to use.

Missing dwarf-style debugging-data-format will result in a message:

The Debugger Status page has as overview which versions are supported and recommended: Debugger_Status#Debug_Info_Support

If a project switches between several Debugger Backends, settings should either be adapted or the lowest recommended version should be used.

Differences between versions

Fpc encodes some data types differently depending on the version of DWARF used. This comprises:

Especially the info for Long/ShortString may affect how different debugger backends display those types. Long/ShortString do not have their own encoding, they are described as either record, array of char or pchar.

DWARFv2 (with/without sets)

For GDB "DWARFv2 with sets" is the best option. Testing shows that, if using other (v3 and up) DWARF (as generated by FPC) then GDB is more likely to crash.

DWARF 2 (the one without "with sets") does not display sets "type TMySet = set of (v1,v2,v3)" correctly.

DWARFv3

DWARFv3 and up, encodes identifiers keeping their case. Instead of "TMYFOOCLASS" the debugger can display "TMyFooClass".


From the Free Pascal wiki, page "DWARF", as it stood on 2023-08-21 after a change by Martin, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.