Re: [PATCH][gdb/symtab] Fix infinite recursion in dwarf2_cu::get_builder()

Eli Zaretskii via Gdb-patches
2021-05-06T15:17:08Z

> Date: Thu, 6 May 2021 14:02:49 +0200
> From: Tom de Vries <tdevries@suse.de>
> Cc: Tom Tromey <tom@tromey.com>
>
> Removing this code (that is, doing SYMBOL_IS_ARGUMENT (sym) = 1
> unconditially), fixes the crash. The ancestor variable also seems to have
> been added specifically to deal with fallout from this code, so remove that as
> well.
>
> Tested on x86_64-linux:
> - openSUSE Leap 15.2 with gcc 7.5.0, and
> - openSUSE Tumbleweed with gcc 10.3.0.
>
> Any comments?
>
> Thanks,
> - Tom
>
> [gdb/symtab] Fix infinite recursion in dwarf2_cu::get_builder()
>
> gdb/ChangeLog:
>
> 2021-05-06 Tom de Vries <tdevries@suse.de>
>
> PR symtab/26327
> * dwarf2/read.c (struct dwarf2_cu): Remove ancestor.
> (dwarf2_cu::get_builder): Remove ancestor-related code.
> (new_symbol): Remove code supporting pre-4.1 gcc that show arguments
> of inlined functions as locals.
> (follow_die_offset, follow_die_sig_1): Remove setting of ancestor.
>
> ---
> gdb/doc/gdb.texinfo | 4 ++--
> gdb/dwarf2/read.c | 25 ++-----------------------
> 2 files changed, 4 insertions(+), 25 deletions(-)
>
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 56f37eb2288..f4d7085da58 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -13842,8 +13842,8 @@ when using @sc{dwarf 2}. Versions of @value{NGCC} before 4.1
> do not emit two required attributes (@samp{DW_AT_call_file} and
> @samp{DW_AT_call_line}); @value{GDBN} does not display inlined
> function calls with earlier versions of @value{NGCC}. It instead
> -displays the arguments and local variables of inlined functions as
> -local variables in the caller.
> +displays local variables of inlined functions as local variables in
> +the caller.
>
> The body of an inlined function is directly included at its call site;
> unlike a non-inlined function, there are no instructions devoted to
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c

I'm not sure I understand why you are changing the manual as part of
this fix?