From: Philippe Waroquiers Date: Thu, 27 Jul 2017 19:11:21 +0000 (+0000) Subject: valgrind core side for Add inner requests in VEX (cfr revision 3399) X-Git-Tag: VALGRIND_3_14_0~309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=035340940f204ad50cf71d463ab3be59f606e025;p=thirdparty%2Fvalgrind.git valgrind core side for Add inner requests in VEX (cfr revision 3399) When running Valgrind under Valgrind, the VEX memory allocation (temporary or permanent) was not checked, as there was no inner request. This patch changes VEX to mark the temporary and permanent allocations with redzone, and memory is marked unaddressable when the VEX temporary pool is cleared. The changes are: * add a file libvex_inner.h which mostly takes over what was in pub_core_inner.h (which now just includes libvex_inner.h) * modify main_util.h and main_util.c to mark the temporary and permanent pool with memcheck pool requests to indicate when a block is allocated or freed. * Impact is (should be) none, unless Valgrind is configured as an inner. * Outer memcheck/inner regression tests run on gcc20 (amd64). Nothing (more worrying than the 3.13 self hosting) detected git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16462 --- diff --git a/coregrind/pub_core_inner.h b/coregrind/pub_core_inner.h index 4dbf1b0163..526172006d 100644 --- a/coregrind/pub_core_inner.h +++ b/coregrind/pub_core_inner.h @@ -31,39 +31,8 @@ #ifndef __PUB_CORE_INNER_H #define __PUB_CORE_INNER_H -//-------------------------------------------------------------------- -// PURPOSE: This header should be imported by every file in Valgrind -// which needs specific behaviour when running as an "inner" Valgrind. -// Valgrind can self-host itself (i.e. Valgrind can run Valgrind) : -// The outer Valgrind executes the inner Valgrind. -// For more details, see README_DEVELOPPERS. -//-------------------------------------------------------------------- - -#include "config.h" - -// The code of the inner Valgrind (core or tool code) contains client -// requests (e.g. from helgrind.h, memcheck.h, ...) to help the -// outer Valgrind finding (relevant) errors in the inner Valgrind. -// Such client requests should only be compiled in for an inner Valgrind. -// Use the macro INNER_REQUEST to allow a central enabling/disabling -// of these client requests. -#if defined(ENABLE_INNER) - -// By default, the client requests -// undefine the below to have an inner Valgrind without any annotation. -#define ENABLE_INNER_CLIENT_REQUEST 1 - -#if defined(ENABLE_INNER_CLIENT_REQUEST) -#define INNER_REQUEST(__zza) __zza -#else -#define INNER_REQUEST(__zza) do {} while (0) -#endif - -#else - -#define INNER_REQUEST(__zza) do {} while (0) - -#endif +// For usage and purpose, see libvex_inner.h +#include "libvex_inner.h" #endif // __PUB_CORE_INNER_H