This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] references and -stack-list-variables --simple-values


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]