From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26792 invoked by alias); 19 Aug 2009 08:15:54 -0000 Received: (qmail 26710 invoked by uid 22791); 19 Aug 2009 08:15:51 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,BOTNET,J_CHICKENPOX_64,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Aug 2009 08:15:43 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7J8FcRK003456; Wed, 19 Aug 2009 04:15:38 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7J8FbQ9002200; Wed, 19 Aug 2009 04:15:37 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7J8FZqR031170; Wed, 19 Aug 2009 04:15:36 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n7J8FY5D008473; Wed, 19 Aug 2009 10:15:34 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n7J8FXMl008468; Wed, 19 Aug 2009 10:15:33 +0200 Date: Wed, 19 Aug 2009 13:03:00 -0000 From: Jan Kratochvil To: Chandru Cc: Doug Evans , gdb-patches@sourceware.org Subject: Re: [patch]: inform user that a watchpoint is hit Message-ID: <20090819081532.GA7264@host0.dyn.jankratochvil.net> References: <200908141602.50465.chandru@in.ibm.com> <4A869488.2060407@in.ibm.com> <4A8BB035.6030601@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8BB035.6030601@in.ibm.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes 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/msg00310.txt.bz2 On Wed, 19 Aug 2009 09:56:37 +0200, Chandru wrote: > What I was referring to was the messages like the following to be outputted > on the screen with the patch applied.. > > Program exited normally. > (gdb) r > Starting program: /home/chandru/r > Hardware access (read/write) watchpoint 2: value1 > Hardware read watchpoint 3: value1 > Hardware access (read/write) watchpoint 2: value1 > Hardware read watchpoint 3: value1 > Hardware access (read/write) watchpoint 2: value1 > Hardware read watchpoint 3: value1 > Hardware access (read/write) watchpoint 2: value1 > Hardware read watchpoint 3: value1 > Hardware access (read/write) watchpoint 2: value1 > Hardware read watchpoint 3: value1 > Hardware access (read/write) watchpoint 2: value1 > Hardware read watchpoint 3: value1 > > Breakpoint 1, main () at rwatch.c:20 > 20 value1 =3; > (gdb) > > I was using a distribution supplied gdb-6.8.50 and found that upstream > gdb shows the same behaviour. gdb-6.6 outputs these messages > without the patch when a program is restarted. This is not reproducible for me. * Which distribution? * Which exact NVR (name-version-release) of the distribution package? * The URL http://sourceware.org/ml/gdb-patches/2009-08/msg00254.html was referring to 4 patches, do you have all of them applied? (but these 4 patches have no effect on this testcase for me, shown as "archer-jankratochvil-watchpoint" below) * Please provide both the testcase and complete GDB run screenshot in the same mail. Once you refer to "rawatch.c", second time "rwatch.c". When you provide a screenshot refer to all the exact versions and possible patches applied to it. * Provide the architecture in use (x86_64? i686? could it be ppc64?). * Provide even the compiler version used. * Provide the kernel version in use due to various ptrace syscall bugsin the past and present (asking primarily for the possibility of ppc64 in use and the watchpoints on it). Thanks, Jan $ cat >rwatch.c #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; } $ gcc -o rwatch rwatch.c -Wall -g $ ~/redhat/gdb-clean/gdb/gdb -nx ./rwatch GNU gdb (GDB) 6.8.50.20090819-cvs Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... (gdb) break main Breakpoint 1 at 0x4004a5: file rwatch.c, line 20. (gdb) run Starting program: /home/jkratoch/t/rwatch Breakpoint 1, main () at rwatch.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 0x00000000004004b5 in main () at rwatch.c:21 21 value2 = value1; (gdb) Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = 3 New value = 0 main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware read watchpoint 2: value1 Value = 0 Hardware access (read/write) watchpoint 3: value1 Value = 0 0x00000000004004d3 in main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = 0 New value = 1 main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware read watchpoint 2: value1 Value = 1 Hardware access (read/write) watchpoint 3: value1 Value = 1 0x00000000004004d3 in main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = 1 New value = 2 func1 () at rwatch.c:10 10 value2=value1; (gdb) Continuing. Hardware read watchpoint 2: value1 Value = 2 Hardware access (read/write) watchpoint 3: value1 Value = 2 0x0000000000400490 in func1 () at rwatch.c:10 10 value2=value1; (gdb) Continuing. Program exited normally. (gdb) run Starting program: /home/jkratoch/t/rwatch Breakpoint 1, main () at rwatch.c:20 20 value1 =3; (gdb) c Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = -1 New value = 3 0x00000000004004b5 in main () at rwatch.c:21 21 value2 = value1; (gdb) q A debugging session is active. Inferior 2 [process 7180] will be killed. Quit anyway? (y or n) y $ ~/redhat/archer-jankratochvil-watchpoint/gdb/gdb -nx ./rwatch GNU gdb (GDB) 6.8.50.20090818-cvs Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... (gdb) break main Breakpoint 1 at 0x4004a5: file rwatch.c, line 20. (gdb) run Starting program: /home/jkratoch/t/rwatch Breakpoint 1, main () at rwatch.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 0x00000000004004b5 in main () at rwatch.c:21 21 value2 = value1; (gdb) Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = 3 New value = 0 main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware read watchpoint 2: value1 Value = 0 Hardware access (read/write) watchpoint 3: value1 Value = 0 0x00000000004004d3 in main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = 0 New value = 1 main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware read watchpoint 2: value1 Value = 1 Hardware access (read/write) watchpoint 3: value1 Value = 1 0x00000000004004d3 in main () at rwatch.c:24 24 value2 = value1; (gdb) Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = 1 New value = 2 func1 () at rwatch.c:10 10 value2=value1; (gdb) Continuing. Hardware read watchpoint 2: value1 Value = 2 Hardware access (read/write) watchpoint 3: value1 Value = 2 0x0000000000400490 in func1 () at rwatch.c:10 10 value2=value1; (gdb) Continuing. Program exited normally. (gdb) run Starting program: /home/jkratoch/t/rwatch Breakpoint 1, main () at rwatch.c:20 20 value1 =3; (gdb) cont Continuing. Hardware access (read/write) watchpoint 3: value1 Old value = -1 New value = 3 0x00000000004004b5 in main () at rwatch.c:21 21 value2 = value1; (gdb) q A debugging session is active. Inferior 2 [process 7244] will be killed. Quit anyway? (y or n) y $ readelf -wi rwatch|grep producer < c> DW_AT_producer : (indirect string, offset: 0x1c): GNU C 4.4.0 20090506 (Red Hat 4.4.0-4) $ rpm -q gcc gcc-4.4.0-4.x86_64 $ cat /proc/version Linux version 2.6.29.5-191.fc11.x86_64 (mockbuild@x86-5.fedora.phx.redhat.com) (gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC) ) #1 SMP Tue Jun 16 23:23:21 EDT 2009 $ rpm -q kernel kernel-2.6.29.5-191.fc11.x86_64 $ cat /etc/fedora-release Fedora release 11 (Leonidas) $ _