Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-11

debug formats, differences and options?

8 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

A few questions about the different debug formats (stabs, dwarf 1,2,3(,4))

I don't know at which stage debug info is added: when creating .ppu/o or when creating .exe
That is to say, when a unit is compiled into a ppu, do you already need to decide on which format to use, or can you use one ppu and later decide if the exe schould have dwarf or stabs?

In case it is in the ppu, are later dwarf downward compatible? eg, compiling units with -gw3 or -gw4 => will it allow to create an exe with -gw1 ?

Is there a list of the advantages, disadvantages of each format. (I understand dwarf 3, and 4 are unstable, but what extra features to they add (as in actually implemented features in fpc)

Martin

Reply by email

Jonas Maebe
to Martin
Martin wrote 8 lines
A few questions about the different debug formats (stabs, dwarf 1,2,3(,4)) I don't know at which stage debug info is added: when creating .ppu/ o or when creating .exe That is to say, when a unit is compiled into a ppu, do you already need to decide on which format to use, or can you use one ppu and later decide if the exe schould have dwarf or stabs?

The debug information is part of the object file format and hence is added when compiling the unit.

In case it is in the ppu, are later dwarf downward compatible? eg, compiling units with -gw3 or -gw4 => will it allow to create an exe with -gw1 ?

Yes and no: you can compile your executable with any debug information you want regardless of the debug format used to compile its units, but the debug information in the units will not change. Furthermore, on some platforms, e.g. Mac OS X, the linker will strip all Stabs debug information if at least one object file contains DWARF debug information. On other platforms, the debugger may support mixing debug information in multiple formats in a single binary.

Is there a list of the advantages, disadvantages of each format. (I understand dwarf 3, and 4 are unstable, but what extra features to they add (as in actually implemented features in fpc)

-gw4 does not do anything more than -gw3 at this time (and I don't think that it will any time soon). -gw3 adds support for ansistring/ widestring/dynamic arrays compared to -gw2 (they are treated like plain pointers with -gw2).

Stabs (-gs, the default on most non-64 bit platforms and on Win64) is legacy and will generally not be updated except for small fixes. Some things that -gw2 supports and -gs doesn't are declarations of absolute variables, and of properties that map directly to fields.

Jonas

Reply by email

Graeme Geldenhuys
to Martin: A few questions about the different debug formats (stabs, dwarf 1,2,3(,4)) I don't know…

Op 2010-11-08 16:34, Martin het geskryf:

In case it is in the ppu, are later dwarf downward compatible? eg, compiling units with -gw3 or -gw4 => will it allow to create an exe with -gw1 ?

I can't answer all your other questions, but as per the DWARF spec, 4 is backward compatible with 3, and 3 is somewhat backward compatible with 2.

Show quoted text 5 lines
Is there a list of the advantages, disadvantages of each format. (I understand dwarf 3, and 4 are unstable, but what extra features to they add (as in actually implemented features in fpc) From all the papers I have read I understood it as follows. DWARF 2 spec

was a mess and very vague. This caused most implementations to be incompatible with other implementations. DWARF 3 is the first "real standardized" spec that also tries to be future-proof - whereas it can be extended by vendors without having to submit those extensions to become part of the next DWARF spec. eg: you can define new types using existing attributes etc. DWARF 4 simply builds on DWARF 3, but I haven't read in detail what exactly is new.

As for FPC's DWARF support. The DWARF 3 class is a descendant of the DWARF 2 class. So I presume some things are reused in DWARF 3 output.... but how correct that DWARF 3 out is, is another question.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Paul Ishenin
to Jonas Maebe: The debug information is part of the object file format and hence is added when compiling…
Jonas Maebe wrote
Stabs (-gs, the default on most non-64 bit platforms and on Win64) is legacy and will generally not be updated except for small fixes. Some things that -gw2 supports and -gs doesn't are declarations of absolute variables, and of properties that map directly to fields.

Btw, maybe it is a time to change the default value for win32 to use -gw2? Also I successfully use -godwarfsets for more than a year without problems.

Best regards,
Paul Ishenin.

Reply by email

Martin
to Paul Ishenin
Paul Ishenin wrote 8 lines
08.11.2010 21:54, Jonas Maebe wrote: > Stabs (-gs, the default on most non-64 bit platforms and on Win64) is > legacy and will generally not be updated except for small fixes. Some > things that -gw2 supports and -gs doesn't are declarations of > absolute variables, and of properties that map directly to fields. Btw, maybe it is a time to change the default value for win32 to use -gw2? Also I successfully use -godwarfsets for more than a year without problems.

+1

dwarfset +1

Reply by email

Joost van der Sluis
to Jonas Maebe: The debug information is part of the object file format and hence is added when compiling…
Jonas Maebe wrote 10 lines
> Is there a list of the advantages, disadvantages of each format. (I > understand dwarf 3, and 4 are unstable, but what extra features to > they add (as in actually implemented features in fpc) -gw4 does not do anything more than -gw3 at this time (and I don't think that it will any time soon). -gw3 adds support for ansistring/ widestring/dynamic arrays compared to -gw2 (they are treated like plain pointers with -gw2).

Also, if you use -gw3, all identifiers are not converted to uppercase, as -gw2 and -gs do.

Joost.

Reply by email

Martin
to Paul Ishenin: Btw, maybe it is a time to change the default value for win32 to use -gw2? Also I…
Paul Ishenin wrote 8 lines
08.11.2010 21:54, Jonas Maebe wrote: > Stabs (-gs, the default on most non-64 bit platforms and on Win64) is > legacy and will generally not be updated except for small fixes. Some > things that -gw2 supports and -gs doesn't are declarations of > absolute variables, and of properties that map directly to fields. Btw, maybe it is a time to change the default value for win32 to use -gw2? Also I successfully use -godwarfsets for more than a year without problems.

btw, there is one issue with dwarf:

http://bugs.freepascal.org/view.php?id=17803

Reply by email