aboutsummaryrefslogtreecommitdiff
path: root/README_DEVELOPERS
diff options
context:
space:
mode:
authortom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-11-17 12:31:12 +0000
committertom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-11-17 12:31:12 +0000
commit4a5223b35b2e773792ee3aabfaa24753eebc4893 (patch)
tree2d40cbb7104e24ce4ed62533c46546a7c34c0cdd /README_DEVELOPERS
parent05e4f8e4813ac11786f755e4e8366adec4aac1e6 (diff)
downloadvalgrind-4a5223b35b2e773792ee3aabfaa24753eebc4893.tar.gz
Update README_DEVELOPERS to describe how to debug valgrind more
easily. Based on patch from Yao Qi <qiyaoltc@cn.ibm.com>. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5165 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'README_DEVELOPERS')
-rw-r--r--README_DEVELOPERS31
1 files changed, 23 insertions, 8 deletions
diff --git a/README_DEVELOPERS b/README_DEVELOPERS
index defce7859..a3e835e7f 100644
--- a/README_DEVELOPERS
+++ b/README_DEVELOPERS
@@ -35,20 +35,35 @@ file. Eg:
Debugging Valgrind with GDB
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To debug stage 1 just run it under GDB in the normal way.
+To debug the valgrind launcher program (<prefix>/bin/valgrind) just
+run it under gdb in the normal way.
-To debug Valgrind proper (stage 2) with GDB, start Valgrind like this:
+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:
- valgrind --tool=none --wait-for-gdb=yes <prog>
+(1) Set VALGRIND_LAUNCHER to <prefix>/bin/valgrind:
-Then start gdb like this in another terminal:
+ export VALGRIND_LAUNCHER=/usr/local/bin/valgrind
- gdb /usr/lib/valgrind/stage2 <pid>
+(2) Run "gdb <prefix>/lib/valgrind/<platform>/<tool>":
-Where <pid> is the pid valgrind printed. Then set whatever breakpoints
-you want and do this in gdb:
+ gdb /usr/local/lib/valgrind/ppc32-linux/lackey
- jump *$eip
+(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
+
+(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:
+
+ (gdb) b vgPlain_do_exec
+
+(5) Run the tool with required options:
+
+ (gdb) run pwd
Self-hosting