This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Decode "is a variable with complex or multiple locations" (PR 8399)
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, roland at redhat dot com
- Date: Mon, 21 Sep 2009 06:18:19 +0300
- Subject: Re: [rfc] Decode "is a variable with complex or multiple locations" (PR 8399)
- References: <20090916201132.366872766@magilla.sf.frob.com> <20090920205109.GA24360@host0.dyn.jankratochvil.net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sun, 20 Sep 2009 22:51:09 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: Roland McGrath <roland@redhat.com>
>
> the attached patch now prints:
>
> (gdb) info address val
> Symbol "val" is a variable with multiple locations, for PC inclusive - exclusive:
> 0x5157c9 - 0x5157e9: stored relative to frame base at offset -20
> 0x5157e9 - 0x5157f2: stored relative to register rsp at offset 60
> 0x5157f2 - 0x515835: stored relative to frame base at offset -20
> and optimized out in ranges not covered above.
This is a very useful feature, thanks.
> (a) While it does what `info address' should do I think you (+me) wished more
> just the single line valid for the current PC.
>
> This would do `info scope *$pc' but that one prints _all_ the visible
> variables with no way how to request just one variable.
We could have "info scope *$pc VAR" that does it for a single
variable.
> As the attached patch mostly just reimplements already available readelf
Does it mean this patch will only work with ELF-based executables, not
with any executable that uses DWARF-2?
> one should probably change `info address' to print it only for the current
> PC address.
Yes, I agree.