A couple of new valgrind instrumentations for better support.

This commit is contained in:
Eric Pouech 2006-02-14 13:06:29 +01:00 committed by Alexandre Julliard
parent 63e8d34a42
commit c67bc2260c
2 changed files with 16 additions and 0 deletions

View File

@ -46,6 +46,10 @@
#include "wine/unicode.h"
#include "wine/debug.h"
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
WINE_DEFAULT_DEBUG_CHANNEL(process);
WINE_DECLARE_DEBUG_CHANNEL(file);
WINE_DECLARE_DEBUG_CHANNEL(relay);
@ -932,6 +936,11 @@ static void *init_stack(void)
NtCurrentTeb()->Tib.StackBase = (char *)base + stack_size;
NtCurrentTeb()->Tib.StackLimit = (char *)base + page_size;
#ifdef VALGRIND_STACK_REGISTER
/* no need to de-register the stack as it's the one of the main thread */
VALGRIND_STACK_REGISTER(NtCurrentTeb()->Tib.StackLimit, NtCurrentTeb()->Tib.StackBase);
#endif
/* setup guard page */
VirtualProtect( base, page_size, PAGE_NOACCESS, NULL );
return NtCurrentTeb()->Tib.StackBase;

View File

@ -56,6 +56,10 @@
#include "wine/library.h"
#include "ntdll_misc.h"
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
/***********************************************************************
* signal context platform-specific definitions
*/
@ -983,6 +987,9 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun
}
stack--; /* push the stack_layout structure */
#ifdef HAVE_VALGRIND_MEMCHECK_H
VALGRIND_MAKE_WRITABLE(stack, sizeof(*stack));
#endif
stack->ret_addr = (void *)0xdeadbabe; /* raise_func must not return */
stack->rec_ptr = &stack->rec;
stack->context_ptr = &stack->context;