Hi all,
What is the best way of being able track accesses to a specific location
via gdbstub? I'm trying to investigate a potential memory-clobbering bug
in OpenBIOS on SPARC64 but using "watch" on a variable via gdbstub
causes gdb to segfault, e.g.:
bu...@zeno:~/src/openbios/openbios-devel$ sparc64-linux-gdb
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
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 "--host=x86_64-unknown-linux-gnu
--target=sparc64-linux".
(gdb) file obj-sparc64/openbios-builtin.elf.nostrip
Reading symbols from
/home/build/src/openbios/openbios-devel/obj-sparc64/openbios-builtin.elf.nostrip...done.
(gdb) watch foo
Watchpoint 1: foo
(gdb) target remote :1234
Remote debugging using :1234
[New Thread 1]
0x000001fff0000020 in ?? ()
(gdb) cont
Continuing.
Segmentation fault
Basically I'm looking for a way of causing gdb to break when a
particular memory location is written so I can execute a backtrace and
figure out the culprit. I'd be quite happy to hardcode an address to
force a break in gdb somewhere within the qemu source as workaround if
someone could point me in the right direction?
Many thanks,
Mark.
--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063
Sirius Labs: http://www.siriusit.co.uk/labs