aboutsummaryrefslogtreecommitdiff
path: root/include/valgrind.h
diff options
context:
space:
mode:
authorrjwalsh <rjwalsh@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-06-04 20:42:33 +0000
committerrjwalsh <rjwalsh@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-06-04 20:42:33 +0000
commit0140af5b913b1a57b5c28ef776bbb2dda23e8b64 (patch)
tree0dd1de9143434c8a81f27f51d66251c7793e399a /include/valgrind.h
parentb507ae67cdcc8cee27e16eeeb47d7cdeb5a0d2e3 (diff)
downloadvalgrind-0140af5b913b1a57b5c28ef776bbb2dda23e8b64.tar.gz
Implement stack registration client requests. See the documentation
in the user manual for usage information. The stack_changes.c file in corecheck/tests contains a short example. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3846 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'include/valgrind.h')
-rw-r--r--include/valgrind.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/include/valgrind.h b/include/valgrind.h
index 750a9d945..9e29bf242 100644
--- a/include/valgrind.h
+++ b/include/valgrind.h
@@ -232,7 +232,12 @@ typedef
/* Allow printfs to valgrind log. */
VG_USERREQ__PRINTF = 0x1401,
- VG_USERREQ__PRINTF_BACKTRACE = 0x1402
+ VG_USERREQ__PRINTF_BACKTRACE = 0x1402,
+
+ /* Stack support. */
+ VG_USERREQ__STACK_REGISTER = 0x1501,
+ VG_USERREQ__STACK_DEREGISTER = 0x1502,
+ VG_USERREQ__STACK_CHANGE = 0x1503,
} Vg_ClientRequest;
#ifndef __GNUC__
@@ -421,4 +426,30 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
pool, addr, 0, 0); \
}
+/* Mark a piece of memory as being a stack. Returns a stack id. */
+#define VALGRIND_STACK_REGISTER(start, end) \
+ ({unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__STACK_REGISTER, \
+ start, end, 0, 0); \
+ _qzz_res; \
+ })
+
+/* Unmark the piece of memory associated with a stack id as being a
+ stack. */
+#define VALGRIND_STACK_DEREGISTER(id) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__STACK_DEREGISTER, \
+ id, 0, 0, 0); \
+ }
+
+/* Change the start and end address of the stack id. */
+#define VALGRIND_STACK_CHANGE(id, start, end) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__STACK_CHANGE, \
+ id, start, end, 0); \
+ }
+
#endif /* __VALGRIND_H */