From: Julian Seward Date: Sat, 16 Nov 2002 11:06:50 +0000 (+0000) Subject: Merge patch from JeremyF: X-Git-Tag: svn/VALGRIND_1_9_4~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0191bd2bd6e8691d43f61b829a99bc9402fc468e;p=thirdparty%2Fvalgrind.git Merge patch from JeremyF: 27-nvalgrind Make valgrind.h pay attention to the preprocessor symbol NVALGRIND. If defined, it compiles out the Valgrind magic sequence and just assigns the result with the default return. This is analogous to NDEBUG's effect on assert(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1320 --- diff --git a/include/valgrind.h b/include/valgrind.h index 789d65d494..dad18ee650 100644 --- a/include/valgrind.h +++ b/include/valgrind.h @@ -76,6 +76,7 @@ +#ifndef NVALGRIND /* This defines the magic code sequence which the JITter spots and handles magically. Don't look too closely at this; it will rot your brain. Valgrind dumps the result value in %EDX, so we first @@ -111,7 +112,22 @@ : "eax", "edx", "cc", "memory" \ ); \ } - +#else /* NVALGRIND */ +/* Define NVALGRIND to completely remove the Valgrind magic sequence + from the compiled code (analogous to NDEBUG's effects on + assert()) */ +#define VALGRIND_MAGIC_SEQUENCE( \ + _zzq_rlval, /* result lvalue */ \ + _zzq_default, /* result returned when running on real CPU */ \ + _zzq_request, /* request code */ \ + _zzq_arg1, /* request first param */ \ + _zzq_arg2, /* request second param */ \ + _zzq_arg3, /* request third param */ \ + _zzq_arg4 /* request fourth param */ ) \ + { \ + (_zzq_rlval) = (_zzq_default); \ + } +#endif /* NVALGRIND */ /* Some request codes. There are many more of these, but most are not exposed to end-user view. These are the public ones, all of the