Valgrind 2.1.0 patches

This patch is against the final Valgrind 2.1 release. This patch isn't heavily tested as it was originally developed against the 2.4.0 tree, so caveat emptor.

Last update: Sun, 15 Feb 2004 13:10:08 -0800

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.

 valgrind-2.1.0-wp/memcheck/docs/mc_main.html           |   42 +
 valgrind-2.1.0-wp/memcheck/mc_clientreqs.c             |    8 
 valgrind-2.1.0-wp/memcheck/mc_include.h                |    3 
 valgrind-2.1.0-wp/memcheck/mc_main.c                   |  401 ++++++++++++++++-
 valgrind-2.1.0-wp/memcheck/memcheck.h                  |   26 +
 valgrind-2.1.0-wp/memcheck/tests/Makefile.am           |    9 
 valgrind-2.1.0-wp/memcheck/tests/wp_cmdline.c          |   19 
 valgrind-2.1.0-wp/memcheck/tests/wp_cmdline.stderr.exp |   15 
 valgrind-2.1.0-wp/memcheck/tests/wp_cmdline.vgtest     |    2 
 valgrind-2.1.0-wp/memcheck/tests/wp_simple.c           |   17 
 valgrind-2.1.0-wp/memcheck/tests/wp_simple.stderr.exp  |   14 
 valgrind-2.1.0-wp/memcheck/tests/wp_simple.vgtest      |    1 
 valgrind-2.1.0-wp/memcheck/tests/wp_stack.c            |   26 +
 valgrind-2.1.0-wp/memcheck/tests/wp_stack.stderr.exp   |   30 +
 valgrind-2.1.0-wp/memcheck/tests/wp_stack.vgtest       |    1 
 15 files changed, 590 insertions(+), 24 deletions(-)

Robert Walsh <rjwalsh@durables.org>