This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] references and -stack-list-variables --simple-values
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 26 Mar 2010 11:05:29 -0400
- Subject: Re: [RFC] references and -stack-list-variables --simple-values
- References: <201003261250.48217.vladimir@codesourcery.com>
On Fri, Mar 26, 2010 at 12:50:48PM +0300, Vladimir Prus wrote:
>
> I've noticed that -stack-list-variables, with the --simple-values option,
> will still print value that have 'reference to complex thing' type, such
> as references to structures. This does not seem right, so the attached
> patch fixes it.
No patch attached.
> The only concern I have is that somehow, adding a local
> reference variable makes the order of variables in GDB output change in
> a random way. That is, given:
>
> int A=1;
> int B=2;
> int C;
> int D[3] = {0, 1, 2};
> int (&E)[3] = D;
>
> GDB outputs A, C, E, B, D in that order. Is that expected and test adjustment
> is right, or I need something else?
GDB goes to some trouble (ordered dictionaries) to preserve the order
in the debug info. Could you check the dwarf with readelf -wi before
and after the change? If this is compiler dependent, we might need a
more flexible test.
--
Daniel Jacobowitz
CodeSourcery