* dwarf2read.c (read_subroutine_type): Add the subroutine type to the
authorGaius Mulley <gaius@glam.ac.uk>
Wed, 16 Dec 2009 15:09:43 +0000 (15:09 +0000)
committerGaius Mulley <gaius@glam.ac.uk>
Wed, 16 Dec 2009 15:09:43 +0000 (15:09 +0000)
die immediately to allow a parameter type to be the same subroutine type.

gdb/ChangeLog
gdb/dwarf2read.c

index 024ab277598a01cd1b9bd60c26dfcb6bda38b8f2..d0289daf03ad45fe1fd9cfbd24208f88fe99b28f 100644 (file)
@@ -1,3 +1,9 @@
+2009-12-15  Gaius Mulley  <gaius@glam.ac.uk>
+
+       * dwarf2read.c (read_subroutine_type): Add the subroutine
+       type to the die immediately to allow a parameter type to be
+       the same subroutine type.
+
 2009-12-15  Tristan Gingold  <gingold@adacore.com>
 
        * machoread.c (macho_symfile_read): Set section size of dsym bfd
index 13f3c7a27eed80f62d76eb5914a02c31e239b7df..ffeaaf2331b58a7a8bebbe3e91b5f5a3e0971b0f 100644 (file)
@@ -5879,6 +5879,11 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
      the default value DW_CC_normal.  */
   attr = dwarf2_attr (die, DW_AT_calling_convention, cu);
   TYPE_CALLING_CONVENTION (ftype) = attr ? DW_UNSND (attr) : DW_CC_normal;
+
+  /* We need to add the subroutine type to the die immediately so
+     we don't infinitely recurse when dealing with parameters
+     declared as the same subroutine type. */
+  set_die_type (die, ftype, cu);
   
   if (die->child != NULL)
     {
@@ -5926,7 +5931,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
        }
     }
 
-  return set_die_type (die, ftype, cu);
+  return ftype;
 }
 
 static struct type *
This page took 0.041226 seconds and 4 git commands to generate.