diff --git a/coregrind/core.h b/coregrind/core.h index f06475080..f715672de 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -113,17 +113,16 @@ #define VG_USERREQ__LIBC_FREERES_DONE 0x3029 /* Intercept prefix stuff. See - coregrind/m_replace_malloc/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 + coregrind/m_replace_malloc/vg_replace_malloc.c for details. */ +#define VG_INTERCEPT(name) _vgi_##name +#define VG_INTERCEPT_PREFIX "_vgi_" +#define VG_INTERCEPT_PREFIX_LEN 5 /* 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 +#define VG_WRAPPER_PREFIX "_vgw_" +#define VG_WRAPPER_PREFIX_LEN 5 +#define VG_WRAPPER(name) _vgw_##name +#define VG_WRAPPER_ALIAS(name) "_vgw_" #name /* --------------------------------------------------------------------- diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 023d2103a..cac07cc75 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -96,14 +96,7 @@ Z --> ZZ */ - -/* It would be nice to be able to write VG_INTERCEPT_PREFIX instead of - "_vgi_" here, but I can't figure out how to get cpp to cooperate. - If you change this "_vgi_" you should also change the definitiion - of VG_INTERCEPT_PREFIX in core.h accordingly. -*/ -#define ENCODE(libname,fnname) _vgi_##libname##_##fnname - +#define ENCODE(libname,fnname) VG_INTERCEPT(libname##_##fnname) /* Some handy mangled names */ #define m_libstc_plus_plus_star libstdcZpZpZa // libstdc++*