Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* tracing variables - is it ok?
@ 2007-06-01  7:59 Bogdan Slusarczyk
  2007-06-01  8:37 ` Vladimir Prus
  0 siblings, 1 reply; 5+ messages in thread
From: Bogdan Slusarczyk @ 2007-06-01  7:59 UTC (permalink / raw)
  To: gdb

Hi everybody, suppose such code:

void testB( int a ) { //a == 20
    int k = a;
}
void testA( int a ) { //a == 10
    int k = a;
     testB( 20 );
}
void main() {
    testA( 10 );
}

Inside testA I did '-var-create - @ a' and inside testB '-var-update', 
but gdb (6.3, 6.6) says that nothing changes and returns a==10 from 
testA. Is it intended behaviour? How can I properly trace variable 
changes? It applies not only for function arguments - I tryied do the 
same thing with 'k', there is the same problem. It strange for me 
because '-var-create - @' handles scope changes properly (see below)
{
    int a = 10;
    {
       int a = 20;
    }
}


Regards,
Bogdan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tracing variables - is it ok?
  2007-06-01  7:59 tracing variables - is it ok? Bogdan Slusarczyk
@ 2007-06-01  8:37 ` Vladimir Prus
  2007-06-01  9:13   ` Bogdan Slusarczyk
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2007-06-01  8:37 UTC (permalink / raw)
  To: gdb

Bogdan Slusarczyk wrote:

> Hi everybody, suppose such code:
> 
> void testB( int a ) { //a == 20
>     int k = a;
> }
> void testA( int a ) { //a == 10
>     int k = a;
>      testB( 20 );
> }
> void main() {
>     testA( 10 );
> }
> 
> Inside testA I did '-var-create - @ a' and inside testB '-var-update',
> but gdb (6.3, 6.6) says that nothing changes and returns a==10 from
> testA. 

This seems weird. Can you also print 'a' right after creating varobj,
and right after -var-update, to make sure it's the problem with
variable objects, and not with something else. Please do this test with
gdb 6.6, or better yet, with CVS version.

Thanks,
Volodya



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tracing variables - is it ok?
  2007-06-01  8:37 ` Vladimir Prus
@ 2007-06-01  9:13   ` Bogdan Slusarczyk
  2007-06-01  9:17     ` Vladimir Prus
  0 siblings, 1 reply; 5+ messages in thread
From: Bogdan Slusarczyk @ 2007-06-01  9:13 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

Vladimir Prus pisze:
> This seems weird. Can you also print 'a' right after creating varobj,
> and right after -var-update, to make sure it's the problem with
> variable objects, and not with something else. Please do this test with
> gdb 6.6, or better yet, with CVS version.
I did -var-evaluate-expression just after creating varobj and I got 
proper value (testA, a=10 ). After -var-update (in testB) value is not 
changed. I did this test with gdb  6.6.

Regards
Bogdan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tracing variables - is it ok?
  2007-06-01  9:13   ` Bogdan Slusarczyk
@ 2007-06-01  9:17     ` Vladimir Prus
  2007-06-01  9:28       ` Bogdan Slusarczyk
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2007-06-01  9:17 UTC (permalink / raw)
  To: Bogdan Slusarczyk; +Cc: gdb

On Friday 01 June 2007 13:13, Bogdan Slusarczyk wrote:
> Vladimir Prus pisze:
> > This seems weird. Can you also print 'a' right after creating varobj,
> > and right after -var-update, to make sure it's the problem with
> > variable objects, and not with something else. Please do this test with
> > gdb 6.6, or better yet, with CVS version.
> I did -var-evaluate-expression just after creating varobj and I got 
> proper value (testA, a=10 ). After -var-update (in testB) value is not 
> changed. I did this test with gdb  6.6.

Please do "print a". The -var-evaluate-expression won't show changed
value if -var-update did not mention a given variable object.

- Volodya


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tracing variables - is it ok?
  2007-06-01  9:17     ` Vladimir Prus
@ 2007-06-01  9:28       ` Bogdan Slusarczyk
  0 siblings, 0 replies; 5+ messages in thread
From: Bogdan Slusarczyk @ 2007-06-01  9:28 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

Vladimir Prus pisze:
> On Friday 01 June 2007 13:13, Bogdan Slusarczyk wrote:
>   
>> Vladimir Prus pisze:
>>     
>>> This seems weird. Can you also print 'a' right after creating varobj,
>>> and right after -var-update, to make sure it's the problem with
>>> variable objects, and not with something else. Please do this test with
>>> gdb 6.6, or better yet, with CVS version.
>>>       
>> I did -var-evaluate-expression just after creating varobj and I got 
>> proper value (testA, a=10 ). After -var-update (in testB) value is not 
>> changed. I did this test with gdb  6.6.
>>     
>
> Please do "print a". The -var-evaluate-expression won't show changed
> value if -var-update did not mention a given variable object.
print 'a' from testA returns 10, from testB returns 20

Bogdan


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-01  9:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-01  7:59 tracing variables - is it ok? Bogdan Slusarczyk
2007-06-01  8:37 ` Vladimir Prus
2007-06-01  9:13   ` Bogdan Slusarczyk
2007-06-01  9:17     ` Vladimir Prus
2007-06-01  9:28       ` Bogdan Slusarczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox