Valgrind 3 SVN trunk patches

These patches are against the Valgrind 3 SVN trunk as of the last update date. They may or may not apply to later versions of the SVN trunk.

Last update: Tue, 13 May 2008 21:44:03 -0700

watchpoints.diff
This patch adds two new client requests: id = VALGRIND_SET_WATCHPOINT(address, length), which allows the application to set a watchpoint on a memory location, and VALGRIND_CLEAR_WATCHPOINT(id), which allows the application to clear a previous watchpoint.

You can also set watchpoints on the command line using --watchpoint=WP,.... WP is of the form X, X-Y or X+Y for a single address, an address range or an address and length, respectively. X and Y can be decimal or hexadecimal numbers. Hexadecimal numbers are prefixed with 0x. You can specify the --watchpoint option as many times as you want.

Watchpoints are triggered when memory within the address range is read or written to, when memory is allocated or freed on top of the address range or when the address range goes into or out of scope on the stack.

When a watchpoint is triggered, the stack backtrace from the triggering location is printed out, along with a count of the number of times the watchpoint has been triggered.

 memcheck/docs/mc-manual.xml          |   55 ++++
 memcheck/mc_main.c                   |  422 +++++++++++++++++++++++++++++++++++
 memcheck/memcheck.h                  |   24 +
 memcheck/tests/Makefile.am           |    4 
 memcheck/tests/wp_cmdline.c          |   17 +
 memcheck/tests/wp_cmdline.stderr.exp |   15 +
 memcheck/tests/wp_cmdline.vgtest     |    2 
 memcheck/tests/wp_simple.c           |   16 +
 memcheck/tests/wp_simple.stderr.exp  |   14 +
 memcheck/tests/wp_simple.vgtest      |    1 
 memcheck/tests/wp_stack.c            |   24 +
 memcheck/tests/wp_stack.stderr.exp   |   30 ++
 memcheck/tests/wp_stack.vgtest       |    1 
 13 files changed, 625 insertions(+)

Robert Walsh <rjwalsh@durables.org>