Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Bogdan Slusarczyk <bodzio131@op.pl>
To: gdb@sourceware.org
Subject: tracing variables - is it ok?
Date: Fri, 01 Jun 2007 07:59:00 -0000	[thread overview]
Message-ID: <465FD1AD.9040909@op.pl> (raw)

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


             reply	other threads:[~2007-06-01  7:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01  7:59 Bogdan Slusarczyk [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=465FD1AD.9040909@op.pl \
    --to=bodzio131@op.pl \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox