A couple of new valgrind instrumentations for better support.
This commit is contained in:
parent
63e8d34a42
commit
c67bc2260c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue