This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCHES] Enhance standard DWARF for Ada


Hello,

This patch series aims at enhancing GCC to emit standard DWARF in place of the current GNAT encodings (non-standard DWARF) for a set of "basic" types: dynamic arrays, variable-length records, variant parts, etc.

As most debuggers (including GDB) do not support these DWARF descriptions yet, it is necessary to still make it possible to generate the old GNAT encodings, though. Hence the first change, which introduces an option (-fgnat-encodings=all|gdb|minimal) that selects how much GNAT encodings must be emitted:

- -fgnat-encodings=all emits as much encodings as before (i.e. before these series of patches);

- -fgnat-encodings=gdb (the default) emits all the standard DWARF that the current GDB can handle (so this will vary with time) and emit GNAT encodings for the rest;

- -fgnat-encodings=minimal emits as much standard DWARF as possible in the compiler and still emit GNAT encodings for the rest (this will vary with time as well).

At the moment, there is no difference between -fgnat-encodings=all|gdb but I hope this will change soon thanks to ongoing work on GDB (for instance: <https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=df25ebbd091aebc132f97ffd6ce9cf7964a57981>).

The remaining commits enhance the DWARF back-end (mostly dwarf2out.c), the Ada front-end (mostly gcc/ada/gcc-interface/*) and sometimes adapts the Fortran front-end as well in order to emit this new DWARF. In order to do so, it sometimes introduces new language hooks to pass information that aren't available in trees.

The result has been bootstrapped and regtested successfully on x86_64-linux. Besides, this triggers no regression by default (-fgnat-encodings=gdb). Note however that being unable to test -fgnat-encodings=minimal under with debugger right now, I also have written a small Python testsuite using pyelftools[1] in order to check for a few examples that the expected DIEs/attributes are properly generated (that was useful during development but is very ad-hoc, so I haven't published it yet).

Ok for trunk? Thank you in advance for the review!

[1] https://github.com/eliben/pyelftools/

--
Pierre-Marie de Rodat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]