This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB/MI - var-update/create BUG
On Wed, Oct 27, 2010 at 9:50 AM, Andrew Burgess <aburgess@broadcom.com> wrote:
>> On 26 October 2010 23:02, Behalf Of Eran Ifrah wrote:
>>
>> Here is the debug session for the above code:
>>
>> ( starting from first line of main() )
>> (gdb)
>> -var-create - * mystr._M_dataplus._M_p
>> ^done,name="var1",numchild="1",value="0x28ff28 \"h\\377(\"",type="char
>> *",thread-id="1",has_more="0"
>
> Using "*" ties the creation of the variable to the current frame. Changing to use "@" will create a floating variable that will use the current _active_ frame. This seems to produce the result you are looking for.
>
Thank you! this was exactly what I was overlooked.
I was using the wrong docs link:
http://www.delorie.com/gnu/docs/gdb/gdb_235.html
While I should have looked at:
http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects
> Thanks,
> Andrew
>
>
--
Eran Ifrah
Cross platform, open source C++ IDE: http://www.codelite.org