diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2010-03-26 18:55:30 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2010-03-26 18:55:30 +0000 |
commit | 4a811a977fd05801bf2e4dca29e775ab6345de63 (patch) | |
tree | 272163b48c58078572ebc14a8368d8eb2dd7d132 | |
parent | 907af001f77f9dee04ecb77a6cb0d21a55850033 (diff) | |
download | gdb-4a811a977fd05801bf2e4dca29e775ab6345de63.zip gdb-4a811a977fd05801bf2e4dca29e775ab6345de63.tar.gz gdb-4a811a977fd05801bf2e4dca29e775ab6345de63.tar.bz2 |
* dwarf2read.c (read_func_scope): Also scan specification DIEs
for DW_TAG_imported_module children.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 25 |
2 files changed, 30 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5effdf3..7394509 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2010-03-26 Ulrich Weigand <uweigand@de.ibm.com> + * dwarf2read.c (read_func_scope): Also scan specification DIEs + for DW_TAG_imported_module children. + +2010-03-26 Ulrich Weigand <uweigand@de.ibm.com> + * dwarf2read.c (dwarf2_name): Work around GCC bugzilla debug/41828 by ignoring spurious DW_AT_name attributes for unnamed structs or unions. * completer.c (add_struct_fields): Fix inverted logic. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 2987039..ed25124 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3946,6 +3946,31 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) inherit_abstract_dies (die, cu); + /* If we have a DW_AT_specification, we might need to import using + directives from the context of the specification DIE. See the + comment in determine_prefix. */ + if (cu->language == language_cplus + && dwarf2_attr (die, DW_AT_specification, cu)) + { + struct dwarf2_cu *spec_cu = cu; + struct die_info *spec_die = die_specification (die, &spec_cu); + + while (spec_die) + { + child_die = spec_die->child; + while (child_die && child_die->tag) + { + if (child_die->tag == DW_TAG_imported_module) + process_die (child_die, spec_cu); + child_die = sibling_die (child_die); + } + + /* In some cases, GCC generates specification DIEs that + themselves contain DW_AT_specification attributes. */ + spec_die = die_specification (spec_die, &spec_cu); + } + } + new = pop_context (); /* Make a block for the local symbols within. */ block = finish_block (new->name, &local_symbols, new->old_blocks, |