From: Julian Seward Date: Tue, 5 Jun 2012 07:12:15 +0000 (+0000) Subject: Add macros I_REPLACE_SONAME_FNNAME_Z{U,Z} for general end-user use. X-Git-Tag: svn/VALGRIND_3_8_0~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ede903f6beb1ddb167ba8ba161ff113e7cd11dea;p=thirdparty%2Fvalgrind.git Add macros I_REPLACE_SONAME_FNNAME_Z{U,Z} for general end-user use. The I_WRAP_SONAME_FNNAME_Z{U,Z} equivalents have been present for years. Seems inconsistent for the REPLACE versions to be missing. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12613 --- diff --git a/include/valgrind.h b/include/valgrind.h index 0beea7adc9..d10a5132f7 100644 --- a/include/valgrind.h +++ b/include/valgrind.h @@ -715,6 +715,18 @@ typedef macros. The type of the argument _lval is OrigFn. */ #define VALGRIND_GET_ORIG_FN(_lval) VALGRIND_GET_NR_CONTEXT(_lval) +/* Also provide end-user facilities for function replacement, rather + than wrapping. A replacement function differs from a wrapper in + that it has no way to get hold of the original function being + called, and hence no way to call onwards to it. In a replacement + function, VALGRIND_GET_ORIG_FN always returns zero. */ + +#define I_REPLACE_SONAME_FNNAME_ZU(soname,fnname) \ + VG_CONCAT4(_vgr00000ZU_,soname,_,fnname) + +#define I_REPLACE_SONAME_FNNAME_ZZ(soname,fnname) \ + VG_CONCAT4(_vgr00000ZZ_,soname,_,fnname) + /* Derivatives of the main macros below, for calling functions returning void. */