blob: a7fa4689c49dedddebe766804aa81ea5d8846cd8 [file] [log] [blame]
njne43d3ae2003-05-05 13:04:49 +00001
njne43d3ae2003-05-05 13:04:49 +00002Building and not installing it
3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4To run Valgrind without having to install it, run coregrind/valgrind (prefix
5with "sh" because it's not executable) with the --in-place=<dir> option, where
6<dir> is the root of the source tree (and must be an absolute path). Eg:
7
8 sh ~/grind/head4/coregrind/valgrind --in-place=/homes/njn25/grind/head4
9
10This allows you to compile and run with "make" instead of "make install",
11saving you time.
12
13I recommend compiling with "make --quiet" to further reduce the amount of
14output spewed out during compilation, letting you actually see any errors,
15warnings, etc.
16
17
18Running the regression tests
19~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20To build and run all the regression tests, run "make [--quiet] regtest".
21
22To run a subset of the regression tests, execute:
23
24 perl tests/vg_regtest <name>
25
26where <name> is a directory (all tests within will be run) or a single
27.vgtest test file, or the name of a program which has a like-named .vgtest
28file. Eg:
29
30 perl tests/vg_regtest memcheck
31 perl tests/vg_regtest memcheck/tests/badfree.vgtest
32 perl tests/vg_regtest memcheck/tests/badfree
33
nethercote16b59ee2004-10-09 15:59:05 +000034
35Debugging Valgrind with GDB
36~~~~~~~~~~~~~~~~~~~~~~~~~~~
37To debug Valgrind itself with GDB, start Valgrind like this:
38
39 valgrind --tool=none --wait-for-gdb=yes <prog>
40
41Then start gdb like this in another terminal:
42
43 gdb /usr/lib/valgrind/stage2 <pid>
44
45Where <pid> is the pid valgrind printed. Then set whatever breakpoints
46you want and do this in gdb:
47
48 jump *$eip
49