A major overhaul of how malloc/free intercepts are done. The general
idea is the same -- write functions with special names encoding
sonames and fn names, and have the redir mechanism notice them.
However the way the functions are generated is significantly changed:
* The name mangling scheme has been replaced with one which is just about
simple enough not to need a preprocessing phase. Hence
vg_replace_malloc.c.base is replaced by vg_replace_malloc.c, and
the preprocessor disappears. The demangler in vg_symtab2.c changes
accordingly.
* Kill off the horrendous LIBALIAS macro. In return we have to
enumerate all the redirections longhand, but this is not a big deal.
* Remove use of the GNUisms "attribute alias" and "attribute
protected".
* Remove the hardwired assumption that any C++ new/new[]/etc symbols
we might want to intercept are mangled in GNU style.
* Add more comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3510 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/core.h b/coregrind/core.h
index 04889d1..3204d11 100644
--- a/coregrind/core.h
+++ b/coregrind/core.h
@@ -468,15 +468,18 @@
A synonym for exit. */
#define VG_USERREQ__LIBC_FREERES_DONE 0x3029
-#define VG_INTERCEPT_PREFIX "_vgi__"
-#define VG_INTERCEPT_PREFIX_LEN 6
-#define VG_INTERCEPT(name) _vgi__##name
-#define VG_INTERCEPT_ALIAS(name) "_vgi__" #name
+/* Intercept prefix stuff. See coregrind/vg_replace_malloc.c for
+ details. Unfortunately the "_vgi_" literal is also hardcoded in
+ that file, so if you change this one you must also change the other
+ one. */
+#define VG_INTERCEPT_PREFIX "_vgi_"
+#define VG_INTERCEPT_PREFIX_LEN 5
-#define VG_WRAPPER_PREFIX "_vgw__"
-#define VG_WRAPPER_PREFIX_LEN 6
-#define VG_WRAPPER(name) _vgw__##name
-#define VG_WRAPPER_ALIAS(name) "_vgw__" #name
+/* Not sure what these are for. Todo: clarify */
+#define VG_WRAPPER_PREFIX "_vgw_"
+#define VG_WRAPPER_PREFIX_LEN 5
+#define VG_WRAPPER(name) _vgw_##name
+#define VG_WRAPPER_ALIAS(name) "_vgw_" #name
struct vg_mallocfunc_info {