Thread View: gnu.gdb.bug
1 messages
1 total messages
Started by Nick Roberts
Sun, 12 Feb 2006 11:53
Re: GDB/MI - garbage in first call to -var-evaluate-expression
Author: Nick Roberts
Date: Sun, 12 Feb 2006 11:53
Date: Sun, 12 Feb 2006 11:53
76 lines
3519 bytes
3519 bytes
> I'm hope this is right group.
In practice, no. Most people follow gdb@sources.redhat.com.
> I'm working with GDB/MI. I'm stepping on C++ code (actually it is SystemC
> code). I want to read local variable 'VALIDATED' of current frame:
> -var-create - * VALIDATED
> ^done,name="var2",numchild="0",type="int"
> -var-info-type var2
> ^done,type="int"
> -var-update var2
> ^done,changelist=[{name="var2",in_scope="false"}]
^^^^^^^^^^^^^^^
This says that VALIDATED is no longer in scope. Are you sure that your
program is not executing?
> -var-evaluate-expression var2
> ^done,value="77828156"
> -var-delete var2
> ^done,ndeleted="1"
> As you can see there is garbage instead of real variable value.
> However if I do exactly the same instructions again (no change in debugger
> between) I get proper value:
> -var-create - * VALIDATED
> ^done,name="var3",numchild="0",type="int"
> -var-info-type var3
> ^done,type="int"
> -var-update var3
> ^done,changelist=[]
^^
It looks like VALIDATED is back in scope but that its value was set to 1
before you created the variable object.
> -var-evaluate-expression var3
> ^done,value="1"
> -var-delete var3
> ^done,ndeleted="1"
-var-update should report any changes since last update/creation, and update
object if appropriate:
-var-create - * VALIDATED
^done,name="var1",numchild="0",type="int"
-var-update var1
^done,changelist=[]
-var-evaluate-expression var1
^done,value="77828156"
program executes...
VALIDATE = 5;
program stops
-var-evaluate-expression var1
^done,value="77828156"
-var-update var1
^done,changelist=[{name="var1",in_scope="true",type_changed="false"}]
-var-evaluate-expression var1
^done,value="5"
> GDB 6.3/windows.
GDB 6.4 is available now.
If there is a bug, for someone to be able to fix it, you need to show how it
can be reproduced with a simple test program.
Nick http://www.inet.net.nz/~nickrob
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads