From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31327 invoked by alias); 31 May 2007 10:18:37 -0000 Received: (qmail 31318 invoked by uid 22791); 31 May 2007 10:18:36 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.228) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 May 2007 10:18:34 +0000 Received: by nz-out-0506.google.com with SMTP id s1so95251nze for ; Thu, 31 May 2007 03:18:32 -0700 (PDT) Received: by 10.114.174.2 with SMTP id w2mr457587wae.1180606712469; Thu, 31 May 2007 03:18:32 -0700 (PDT) Received: by 10.114.190.20 with HTTP; Thu, 31 May 2007 03:18:32 -0700 (PDT) Message-ID: Date: Thu, 31 May 2007 10:18:00 -0000 From: "Ulisses Furquim" To: gdb@sourceware.org Subject: Watchpoints in an ARM platform MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00179.txt.bz2 Hi, I was experimenting with gdb 6.6 on an ARM device and I noticed a problem with watchpoints. I was using a simple application I compiled with a cross-compiler like this: $ arm-none-linux-gnueabi-gcc testgdb.c -g3 -O0 -Wall -fno-omit-frame-pointer -o testgdb --sysroot /tftpboot/ltib Here is a gdb session to better show you the problem: $ gdb ./testgdb GNU gdb 6.6 Copyright (C) 2006 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 "arm-none-linux-gnueabi"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) b Dummy1 Breakpoint 1 at 0x8390: file testgdb.c, line 6. (gdb) r Starting program: /testgdb Hello World! Breakpoint 1, Dummy1 () at testgdb.c:6 6 for(i=0; i<10 ; i++) (gdb) l 6 1 #include 2 3 void Dummy1() 4 { 5 int i; 6 for(i=0; i<10 ; i++) 7 { 8 printf("itteration %d\n",i); 9 } 10 } (gdb) rwatch i Target does not support this type of hardware watchpoint. (gdb) awatch i Target does not support this type of hardware watchpoint. (gdb) watch i Watchpoint 2: i (gdb) c Continuing. Watchpoint 2: i Old value = 33480 New value = 0 0x00008398 in Dummy1 () at testgdb.c:6 6 for(i=0; i<10 ; i++) (gdb) c Continuing. Watchpoint 2 deleted because the program has left the block in which its expression is valid. 0x0000828c in ?? () (gdb) n Cannot find bounds of current function (gdb) Cannot find bounds of current function (gdb) q The program is running. Exit anyway? (y or n) y $ It says the target doesn't support that type of hardware watchpoint when I've tried rwatch and awatch, but it works when I use the watch command (maybe using some software watchpoint). After that I can continue and it correctly stops the program the first time, but when I continue again something goes wrong and gdb gets confused. Do you have any idea why this happens? Am I missing anything here? Best regards, -- Ulisses