diff options
author | David Carlton <carlton@bactrian.org> | 2004-03-16 22:43:15 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2004-03-16 22:43:15 +0000 |
commit | 90aeadfcc303595a71f885305570da90f25c04a9 (patch) | |
tree | 8b1b0d8c28d993060455b832713cff54a5092143 | |
parent | 947f426e273a237459d307c06aacedaa219054c3 (diff) | |
download | binutils-90aeadfcc303595a71f885305570da90f25c04a9.zip binutils-90aeadfcc303595a71f885305570da90f25c04a9.tar.gz binutils-90aeadfcc303595a71f885305570da90f25c04a9.tar.bz2 |
2004-03-16 David Carlton <carlton@kealia.com>
* dwarf2read.c (process_structure_scope): Process children even
when we're a declaration.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 36 |
2 files changed, 24 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7a0008e..0fbac05 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-03-16 David Carlton <carlton@kealia.com> + + * dwarf2read.c (process_structure_scope): Process children even + when we're a declaration. + 2004-03-16 Andrew Cagney <cagney@redhat.com> * symtab.h (find_pc_sect_partial_function): Delete declaration. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index c3453ae..285eb6b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3331,33 +3331,35 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; const char *previous_prefix = processing_current_prefix; + struct die_info *child_die = die->child; if (TYPE_TAG_NAME (die->type) != NULL) processing_current_prefix = TYPE_TAG_NAME (die->type); - if (die->child != NULL && ! die_is_declaration (die, cu)) - { - struct die_info *child_die; - - child_die = die->child; + /* NOTE: carlton/2004-03-16: GCC 3.4 (or at least one of its + snapshots) has been known to create a die giving a declaration + for a class that has, as a child, a die giving a definition for a + nested class. So we have to process our children even if the + current die is a declaration. Normally, of course, a declaration + won't have any children at all. */ - while (child_die && child_die->tag) + while (child_die != NULL && child_die->tag) + { + if (child_die->tag == DW_TAG_member + || child_die->tag == DW_TAG_variable + || child_die->tag == DW_TAG_inheritance) { - if (child_die->tag == DW_TAG_member - || child_die->tag == DW_TAG_variable - || child_die->tag == DW_TAG_inheritance) - { - /* Do nothing. */ - } - else - process_die (child_die, cu); - - child_die = sibling_die (child_die); + /* Do nothing. */ } + else + process_die (child_die, cu); - new_symbol (die, die->type, cu); + child_die = sibling_die (child_die); } + if (die->child != NULL && ! die_is_declaration (die, cu)) + new_symbol (die, die->type, cu); + processing_current_prefix = previous_prefix; } |