DWARF: materialize subprogram renamings in Ada as imported declarations
authorPierre-Marie de Rodat <derodat@adacore.com>
Tue, 24 Nov 2015 16:59:43 +0000 (16:59 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 24 Nov 2015 16:59:43 +0000 (16:59 +0000)
commitcaadda8e359e968af9f650d65ed9950fb177f184
tree522018b552faad2113b7bdd5be2a93c93d473835
parent16a21ab32693a8a42f1d20e36e0d10e9c99d7f86
DWARF: materialize subprogram renamings in Ada as imported declarations

... so that debugger users can reference them instead of the renamed
subprograms.  This is in accordance with the DWARF specification: the
section 3.2.3 (Imported (or Renamed) Declaration Entities) allows
DW_TAG_imported_declaration DIEs to be used "as a general means to
rename or provide an alias for an entity regardless of the context in
which the importing declaration or the imported entity occur." (wording
from the DWARFv3 and DWARFv4 specifications, allowed in DWARFv2).

gcc/ada/ChangeLog:

* gcc-interface/utils.c (gnat_write_global_declarations): Output
debugging information for top-level imported declarations.

gcc/ChangeLog:

* dwarf2out.c (gen_decl_die): Generate DW_TAG_imported_* instead
of DW_TAG_namespace for IMPORTED_DECL declarations.  Call
dwarf2out_imported_module_or_decl_1 for all DWARF versions as
this function already takes care of checking what it can emit.

Bootstrapped, regtested and checked with GDB's testsuite on
x86_64-linux.

From-SVN: r230821
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c
gcc/dwarf2out.c