From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25674 invoked by alias); 12 Oct 2005 21:14:34 -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 25660 invoked by uid 22791); 12 Oct 2005 21:14:32 -0000 Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.153) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 12 Oct 2005 21:14:32 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id j9CLBOru002498 for ; Wed, 12 Oct 2005 17:11:24 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j9CLEU8H533738 for ; Wed, 12 Oct 2005 15:14:30 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j9CLEUUg023844 for ; Wed, 12 Oct 2005 15:14:30 -0600 Received: from d03nm113.boulder.ibm.com (d03nm113.boulder.ibm.com [9.17.195.139]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j9CLETfg023809 for ; Wed, 12 Oct 2005 15:14:30 -0600 To: gdb@sourceware.org MIME-Version: 1.0 Subject: gdb watch command on ppc Message-ID: From: Claudia Salzberg Date: Wed, 12 Oct 2005 21:14:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2005-10/txt/msg00081.txt.bz2 Greetings, I have noticed a discrepancy between the way the gdb for ppc handles watchpoints on pointers. I am trying to place a software watchpoint on a variable of type int * and am not getting the expected results. Note that I observe the expected functionality (the watchpoint being correctly set) on x86 and that I have tried the following on today's cvs head. I have also tried this on various ppc machines with the same result. I include the sample program that matches the output shown below as well as an additional program that generates the same behavior. I do not see this if I attempt to place a watchpoint on a non pointer variable. Thanks for your input. -Claudia Salzberg ############################################## #####The output of the gdb session is as follows:##### ############################################## linux:~ # ./gdbhead pointertest GNU gdb 6.3.50.20051012-cvs Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "ppc-linux"...Using host libthread_db library "/lib/. (gdb) dir /root Source directories searched: /root:$cdir:$cwd (gdb) b main Breakpoint 1 at 0x100004c8: file main.c, line 13. (gdb) r Starting program: /root/pointertest Breakpoint 1, main () at main.c:13 13 int *a = (int *)malloc(sizeof(int)); (gdb) watch a Watchpoint 2: a (gdb) c Continuing. Watchpoint 2 deleted because the program has left the block in which its expression is valid. fixup (l=0x7ffff620, reloc_offset=0) at dl-runtime.c:63 63 dl-runtime.c: No such file or directory. in dl-runtime.c (gdb) c Continuing. Done Program exited with code 01. (gdb) ################################## #####The source for pointertest is:##### ################################## int writedata(int *x) { *x = 105; return 1; } int main() { int *a = (int *)malloc(sizeof(int)); writedata(a); free(a); a = NULL; printf("Done\n"); return 1; } ########################### #####An additional test is:##### ########################### main() { int *a; int i=0; for (i=0; i < 10; i++) { a = (int *)malloc(sizeof(int)); free(a); } }