bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDB/MI - garbage in first call to -var-evaluate-expression


From: Nick Roberts
Subject: Re: GDB/MI - garbage in first call to -var-evaluate-expression
Date: Mon, 13 Feb 2006 00:53:01 +1300

> I'm hope this is right group.

In practice, no.  Most people follow address@hidden

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]