diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-02-01 22:45:13 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-02-01 22:45:13 +0000 |
commit | 2cfa0c8ddfd7564ce1695b9251408c7cde6004aa (patch) | |
tree | 877c5d43ba6d91c354511f1e8abdd8118d36ed7f /gdb | |
parent | 8b66833e78c6d0d27e1ebb5ad1a80ecc4f559741 (diff) | |
download | binutils-gdb-2cfa0c8ddfd7564ce1695b9251408c7cde6004aa.tar.gz |
* dwarf2read.c (add_partial_symbol): Always store all Ada subprograms
in the global scope.
(new_symbol): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 15 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cc2bfecadfa..c5380b0aeda 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2007-02-01 Joel Brobecker <brobecker@adacore.com> + + * dwarf2read.c (add_partial_symbol): Always store all Ada subprograms + in the global scope. + (new_symbol): Likewise. + 2008-02-01 Vladimir Prus <vladimir@codesourcery.com> * breakpoint.c (break_command_1): Return void. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 15e168ff9b4..ecba9edfe76 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1898,8 +1898,12 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) switch (pdi->tag) { case DW_TAG_subprogram: - if (pdi->is_external) + if (pdi->is_external || cu->language == language_ada) { + /* brobecker/2007-12-26: Normally, only "external" DIEs are part + of the global scope. But in Ada, we want to be able to access + nested procedures globally. So all Ada subprograms are stored + in the global scope. */ /*prim_record_minimal_symbol (actual_name, pdi->lowpc + baseaddr, mst_text, objfile); */ psym = add_psymbol_to_list (actual_name, strlen (actual_name), @@ -7296,8 +7300,15 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) finish_block. */ SYMBOL_CLASS (sym) = LOC_BLOCK; attr2 = dwarf2_attr (die, DW_AT_external, cu); - if (attr2 && (DW_UNSND (attr2) != 0)) + if ((attr2 && (DW_UNSND (attr2) != 0)) + || cu->language == language_ada) { + /* Subprograms marked external are stored as a global symbol. + Ada subprograms, whether marked external or not, are always + stored as a global symbol, because we want to be able to + access them globally. For instance, we want to be able + to break on a nested subprogram without having to + specify the context. */ add_symbol_to_list (sym, &global_symbols); } else |