[PATCH] Add proper handling for non-local references in nested functions
Kevin Buettner
kevinb@redhat.com
Thu Jul 23 13:44:00 GMT 2015
On Thu, 23 Jul 2015 12:44:19 +0200
Pierre-Marie de Rodat <derodat@adacore.com> wrote:
> Kevin,
>
> On 07/23/2015 02:39 AM, Kevin Buettner wrote:
> > I had to make the following change in order to obtain a clean build
> > using your patches:
> >
> > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> > index e20aead..d6e3d55 100644
> > --- a/gdb/dwarf2read.c
> > +++ b/gdb/dwarf2read.c
> > @@ -11457,7 +11457,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
> >
> > newobj = pop_context ();
> > /* Make a block for the local symbols within. */
> > - block = finish_block (newobj->name, &newobj->static_link,
> > + block = finish_block (newobj->name, newobj->static_link,
> > &local_symbols, newobj->old_blocks,
> > lowpc, highpc);
>
> Huh, I actually have a warning I did not notice but not an error, so I
> guess you built GDB as C++. Anyway, this is a big mistake that should
> have broken the feature I intend to add: quite bad! Thank you very much
> for pointing me at it.
I built it using GCC's C compiler, but with -Werror enabled. This flag
turns warnings into errors.
I'll test your new patch today. I've encountered a GDB bug related to
examining variables with within a nested function. I'm hoping that
your patch will fix it...
Kevin
More information about the Gdb-patches
mailing list