From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14746 invoked by alias); 15 Aug 2009 10:57:33 -0000 Received: (qmail 14683 invoked by uid 22791); 15 Aug 2009 10:57:32 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e28smtp04.in.ibm.com (HELO e28smtp04.in.ibm.com) (59.145.155.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 15 Aug 2009 10:57:24 +0000 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp04.in.ibm.com (8.14.3/8.13.1) with ESMTP id n7FAvJcY016554 for ; Sat, 15 Aug 2009 16:27:19 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n7FAvJS82445384 for ; Sat, 15 Aug 2009 16:27:19 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id n7FAvJcg007217 for ; Sat, 15 Aug 2009 16:27:19 +0530 Received: from [9.77.212.194] ([9.77.212.194]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id n7FAvIr9007212; Sat, 15 Aug 2009 16:27:18 +0530 Message-ID: <4A869488.2060407@in.ibm.com> Date: Sat, 15 Aug 2009 12:22:00 -0000 From: Chandru User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Doug Evans CC: gdb-patches@sourceware.org Subject: Re: [patch]: inform user that a watchpoint is hit References: <200908141602.50465.chandru@in.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00214.txt.bz2 Doug Evans wrote: > On Fri, Aug 14, 2009 at 3:32 AM, Chandru wrote: > >> When a program is restarted within gdb, the initial breakpoint hit messages are >> not outputted on to the screen. Inform the user that a watchpoint has been hit >> >> Signed-off-by: Chandru Siddalingappa >> --- >> >> --- gdb/breakpoint.c.orig 2009-08-14 17:53:06.000000000 +0530 >> +++ gdb/breakpoint.c 2009-08-14 17:54:02.000000000 +0530 >> @@ -842,6 +842,9 @@ update_watchpoint (struct breakpoint *b, >> struct bp_location *loc; >> bpstat bs; >> >> + if (breakpoint_enabled (b)) >> + mention(b); >> + >> unlink_locations_from_global_list (b); >> for (loc = b->loc; loc;) >> { >> >> > > Hi. > If we're stopping because of a watchpoint and not reporting it, that's bad. > But it seems odd that this is happening, and simple experiments don't > reveal anything. > Do you have a testcase? > yes, The steps performed to reproduce are: 1) Compile the following program with debug info 2) Run the program. 3) Set a watchpoint for "value1" variable. 4) Run the test and do some checks. 5) Program exits. Now restart the program execution 6) Expect to see the message of hitting the watchpoint for value1 in main () line 20. #include #include int value1 = -1; int value2 = -1; int func1 () { value1=2; value2=value1; return 0; } int main () { int i; value1 =3; value2 = value1; for (i=0; i<2; i++) { value1 = i; value2 = value1; } func1(); return 0; } --------------- (gdb) break main Breakpoint 1 at 0x8048453: file rawatch.c, line 20. (gdb) run Starting program: /home/vrvazque/rawatch Breakpoint 1, main () at rawatch.c:20 20 value1 =3; (gdb) rwatch value1 Hardware read watchpoint 2: value1 (gdb) awatch value1 Hardware access (read/write) watchpoint 3: value1 (gdb) cont Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = -1 New value = 3 0x08048462 in main () at rawatch.c:21 21 value2 = value1; (gdb) cont ... ... ... (gdb) cont Continuing. Program exited normally. (gdb) run Starting program: /home/vrvazque/rawatch Breakpoint 1, main () at rawatch.c:20 20 value1 =3; (gdb) cont