This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Which MI behavior is correct ?
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Maxim Grigoriev <maxim at tensilica dot com>
- Cc: gdb at sourceware dot org, Pete MacLiesh <pmac at tensilica dot com>, Vinay Pandit <vinayp at tensilica dot com>, Shaiju P <shaijup at tensilica dot com>, Marc Gauthier <marc at tensilica dot com>
- Date: Sat, 19 May 2007 14:19:54 +1200
- Subject: Re: Which MI behavior is correct ?
- References: <464E4C4D.9010709@hq.tensilica.com>
> PROBLEM DESCRIPTION:
> ====================
>
> When we hit the breakpoint inside f11() second time:
>
> In case of 6.3 we have :
>
> 228^done,changelist=[{name="var3",in_scope="true",type_changed="false"}]
> (gdb)
> 229^done,changelist=[{name="var4",in_scope="true",type_changed="false"}]
> (gdb)
> 230^done,value="3"
> (gdb)
> 231^done,value="2"
> (gdb)
>
> In in case of 6.5+ we have :
>
> 228^done,changelist=[{name="var3",in_scope="false"}]
> (gdb)
> 229^done,changelist=[{name="var4",in_scope="false"}]
> (gdb)
> 230^done,value="2"
> (gdb)
> 231^done,value="1"
> (gdb)
>
> So "var3" and "var4" are out of scope.
>
> Our GUI front-end relies on the 6.3-like behavior, which is consistent with
> what we had in our previous releases based on GNU gdb 5.2.1.
>
> QUESTIONS
> =========
>
> 1) Is 6.5(+)-style behavior incorrect ?
That's a loaded question. Your comparing apples and pears. For a true
comparison you should compare GNU gdb Red Hat Linux (6.5) (if possible)
with GNU gdb 6.5 Xtensa Tools.
The former behaviour is correct, and that's what I get with FSF GDB 6.6
I think there is something wrong with your implementation of GDB, or
something nonstansard about f11().
> If it is correct:
>
> - Are we supposed to recreate variables each time we enter the
> function ?
> - Is this efficient ?
Well the variables themselves are reallocated from the stack, so there's
a chance that they're not the same variables. At the moment, however
GDB assumes that they are the same and you don't have to recreate them.
> 2) Where can I find a good documentation describing these aspects of GDB
> MI ?
The info manual has a section called GDB/MI.
--
Nick http://www.inet.net.nz/~nickrob