public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* When do watchpoints go out of scope?
@ 2005-09-25 14:37 Thomas Covenant
  2005-09-25 17:25 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Covenant @ 2005-09-25 14:37 UTC (permalink / raw)
  To: gdb

Consider this program:

1 int main(void)
2 {
3    {
4       int i = 2;
5       printf("i is %d.\n", i);
6       i = 3;
7       printf("i is %d.\n", i);
8    }
9    // lots more code
     ...
90   return 0;
100 }

The variable i goes in scope at line 4, out of scope
at line 8.

If I set:

   watch i

at line 4, I would assume the watchpoint would be
deleted at line 8, since i is no longer in scope.

Yet, the watchpoint persists at line 9 and beyond,
even though i is no longer in scope.

Why is this?  And what exactly is the watchpoint
watching when i is out of scope?

Thanks!


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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

end of thread, other threads:[~2005-10-10 23:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-25 14:37 When do watchpoints go out of scope? Thomas Covenant
2005-09-25 17:25 ` Daniel Jacobowitz
2005-10-10 23:21   ` Ross Morley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).