]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add macros I_REPLACE_SONAME_FNNAME_Z{U,Z} for general end-user use.
authorJulian Seward <jseward@acm.org>
Tue, 5 Jun 2012 07:12:15 +0000 (07:12 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 5 Jun 2012 07:12:15 +0000 (07:12 +0000)
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

include/valgrind.h

index 0beea7adc9b2cc28ef13fbbc40dee0f881891ae1..d10a5132f7f177ac42cad64a3994a4f25a1d8455 100644 (file)
@@ -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. */