From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21305 invoked by alias); 25 Sep 2005 14:37:45 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21276 invoked by uid 22791); 25 Sep 2005 14:37:36 -0000 Received: from web34809.mail.mud.yahoo.com (HELO web34809.mail.mud.yahoo.com) (209.191.68.173) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Sun, 25 Sep 2005 14:37:36 +0000 Received: (qmail 65018 invoked by uid 60001); 25 Sep 2005 14:37:34 -0000 Message-ID: <20050925143734.65016.qmail@web34809.mail.mud.yahoo.com> Received: from [68.83.183.155] by web34809.mail.mud.yahoo.com via HTTP; Sun, 25 Sep 2005 07:37:34 PDT Date: Sun, 25 Sep 2005 14:37:00 -0000 From: Thomas Covenant Subject: When do watchpoints go out of scope? To: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-09/txt/msg00185.txt.bz2 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