From 76c10ea2bb2559aa32ea4b846d30a606b6f78bff Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Wed, 16 Dec 2009 15:09:43 +0000 Subject: [PATCH] * dwarf2read.c (read_subroutine_type): Add the subroutine type to the die immediately to allow a parameter type to be the same subroutine type. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2read.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 024ab277598..d0289daf03a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2009-12-15 Gaius Mulley + + * 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 * machoread.c (macho_symfile_read): Set section size of dsym bfd diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 13f3c7a27ee..ffeaaf2331b 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 * -- 2.30.2