aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorGaius Mulley <gaius@glam.ac.uk>2009-12-16 15:09:43 +0000
committerGaius Mulley <gaius@glam.ac.uk>2009-12-16 15:09:43 +0000
commit76c10ea2bb2559aa32ea4b846d30a606b6f78bff (patch)
treee35228088c2b01428e3be43b85301263c99101fa /gdb/dwarf2read.c
parent25ac7f26dd48640f790f604c7a8e3e9216d0af19 (diff)
downloadgdb-76c10ea2bb2559aa32ea4b846d30a606b6f78bff.zip
gdb-76c10ea2bb2559aa32ea4b846d30a606b6f78bff.tar.gz
gdb-76c10ea2bb2559aa32ea4b846d30a606b6f78bff.tar.bz2
* dwarf2read.c (read_subroutine_type): Add the subroutine type to the
die immediately to allow a parameter type to be the same subroutine type.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 13f3c7a..ffeaaf2 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -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 *