summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-24 16:59:43 +0000
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-24 16:59:43 +0000
commit1ef426cd9d0a281d5e0a33a424554ca5379fff45 (patch)
tree522018b552faad2113b7bdd5be2a93c93d473835 /gcc/ada/gcc-interface/utils.c
parentbab23e46a618d7a72006da8997846104288853b1 (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230821 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index aa2fdf240558..0016a3fa288f 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -5281,6 +5281,13 @@ gnat_write_global_declarations (void)
FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter)
if (TREE_CODE (iter) == VAR_DECL)
rest_of_decl_compilation (iter, true, 0);
+
+ /* Output the imported modules/declarations. In GNAT, these are only
+ materializing subprogram. */
+ FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter)
+ if (TREE_CODE (iter) == IMPORTED_DECL && !DECL_IGNORED_P (iter))
+ debug_hooks->imported_module_or_decl (iter, DECL_NAME (iter),
+ DECL_CONTEXT (iter), 0);
}
/* ************************************************************************