]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-03-16 David Carlton <carlton@kealia.com>
authorDavid Carlton <carlton@bactrian.org>
Tue, 16 Mar 2004 22:46:05 +0000 (22:46 +0000)
committerDavid Carlton <carlton@bactrian.org>
Tue, 16 Mar 2004 22:46:05 +0000 (22:46 +0000)
* dwarf2read.c (process_structure_scope): Process children even
when we're a declaration.

gdb/ChangeLog
gdb/dwarf2read.c

index db0bae27b96aba91ce10f3cee577996725bbcfaf..d29405fe037d1e70573c7c9125051efad8bf32b4 100644 (file)
@@ -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-15  David Carlton  <carlton@kealia.com>
 
        Fix for PR c++/1553:
index 731508370f5990b4fa790667a57e8f1f778de75a..cc69ede557ed6ec2bd03d367714bff7c39fd4c60 100644 (file)
@@ -3170,33 +3170,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;
 }