[RFC] improving the DWARF information emitted for Ada

Jim Wilson wilson@specifix.com
Fri Feb 10 02:20:00 GMT 2006


Nicolas Setton wrote:
> In order to make the transition easier, and to allow time for other  
> tools (mainly gdb) to take advantage of these improvements at their  own 
> schedule, we would like to introduce a command-line switch (- gdwarf+), 
> which will trigger the use of the GNAT vendor extension to  DWARF.

I doubt that anyone outside Adacore cares much about how GNAT emits 
debug info.  However, this bit caught my eye.

Any properly written dwarf reader will ignore attributes it doesn't 
understand, and hence in theory there should be no need for a -gdwarf-2+ 
option.  You can just emit the new info by default and everything should 
work.

If you are proposing -gdwarf-2+ because you want to have support for 
both the old and new Ada debug info, then I think that is a misuse of 
the debug+ convention.  You aren't really adding extensions.  You are 
just changing from stabs hacks to proper dwarf info.  Also, having the 
-gdwarf-2+ option may confuse people into thinking that they need it for 
C++ (which is where the + originally came from).

Not having both means that gdb patches need to get installed first, then 
the gcc patches, and then you document that gcc version X requires gdb 
version Y.  Ordinarily this shouldn't be a problem, but I realize that 
historically gdb support for Ada hasn't been as good as it should be. 
If we really need both old and new formats, I'd suggest a -f option 
first, maybe something like -fada-stabs-encodings to get the old format.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



More information about the Gcc mailing list