From 86b2e5ec21de193264f8b78cb0568fecd802f1a5 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 17 Sep 2007 22:35:57 +0000 Subject: [PATCH] Extra info about debugging with GDB git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6854 --- README_DEVELOPERS | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 06ed8b0ac8..66fec3d118 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -67,13 +67,21 @@ Debugging the main body of the valgrind code (and/or the code for a particular tool) requires a bit more trickery but can be achieved without too much problem by following these steps: -(1) Set VALGRIND_LAUNCHER to /bin/valgrind: +(1) Set VALGRIND_LAUNCHER to point to the valgrind executable. Eg: - export VALGRIND_LAUNCHER=/usr/local/bin/valgrind + export VALGRIND_LAUNCHER=/usr/local/bin/valgrind -(2) Run "gdb /lib/valgrind//": + or for an uninstalled version in a source directory $DIR: - gdb /usr/local/lib/valgrind/ppc32-linux/lackey + export VALGRIND_LAUNCHER=$DIR/coregrind/valgrind + +(2) Run gdb on the tool executable. Eg: + + gdb /usr/local/lib/valgrind/ppc32-linux/lackey + + or + + 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: @@ -90,6 +98,8 @@ without too much problem by following these steps: (gdb) run pwd +Steps (1)--(3) can be put in a .gdbinit file, but any directory names must +be fully expanded (ie. not an environment variable). Self-hosting ~~~~~~~~~~~~ -- 2.47.2