This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Watchpoints in an ARM platform
- From: "Ulisses Furquim" <ulissesf at gmail dot com>
- To: gdb at sourceware dot org
- Date: Thu, 31 May 2007 12:18:32 +0200
- Subject: Watchpoints in an ARM platform
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 <stdio.h>
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