|
From: John R.
|
I found these hints to be helpful. The patch is against valgrind-3.2.3 ,
also svn 6788 with just a 2-line offset.
--- ./README_DEVELOPERS.orig 2007-01-02 06:52:30.000000000 -0800
+++ ./README_DEVELOPERS 2007-08-28 12:45:45.000000000 -0700
@@ -69,15 +69,32 @@
export VALGRIND_LAUNCHER=/usr/local/bin/valgrind
+ [Or, to specify a newly-built but uninstalled version:
+
+ export VALGRIND_LAUNCHER=$dir/coregrind/valgrind
+ ]
+
(2) Run "gdb <prefix>/lib/valgrind/<platform>/<tool>":
gdb /usr/local/lib/valgrind/ppc32-linux/lackey
+ [Or, to debug a newly-built but uninstalled version:
+
+ gdb $dir/.in_place/x86-linux/memcheck
+ ]
+
(3) Do "handle SIGSEGV SIGILL nostop noprint" in GDB to prevent GDB from
stopping on a SIGSEGV or SIGILL:
(gdb) handle SIGILL SIGSEGV nostop noprint
+ [Steps 1-3 may be combined in a .gdbinit file:
+ set env VALGRIND_LAUNCHER=$dir/coregrind/valgrind
+ file $dir/.in_place/x86-linux/memcheck
+ handle SIGILL SIGSEGV nostop noprint
+ However, .gdbinit requires that $dir be expanded to a literal string.
+ ]
+
(4) Set any breakpoints you want and proceed as normal for gdb. The
macro VG_(FUNC) is expanded to vgPlain_FUNC, so If you want to set
a breakpoint VG_(do_exec), you could do like this in GDB:
--
|