forked from OSchip/llvm-project
parent
769d46f373
commit
2629e575db
|
@ -34,19 +34,19 @@ int pthread_key_create(unsigned *key, void (*destructor)(void* v));
|
|||
int pthread_setspecific(unsigned key, const void *v);
|
||||
}
|
||||
|
||||
#define GET_STACK_TRACE \
|
||||
StackTrace stack; \
|
||||
{ \
|
||||
uptr stack_top = 0, stack_bottom = 0; \
|
||||
ThreadContext *t; \
|
||||
bool fast = common_flags()->fast_unwind_on_malloc; \
|
||||
if (fast && (t = CurrentThreadContext())) { \
|
||||
stack_top = t->stack_end(); \
|
||||
stack_bottom = t->stack_begin(); \
|
||||
} \
|
||||
stack.Unwind(__sanitizer::common_flags()->malloc_context_size, \
|
||||
StackTrace::GetCurrentPc(), \
|
||||
GET_CURRENT_FRAME(), stack_top, stack_bottom, fast); \
|
||||
#define GET_STACK_TRACE \
|
||||
StackTrace stack; \
|
||||
{ \
|
||||
uptr stack_top = 0, stack_bottom = 0; \
|
||||
ThreadContext *t; \
|
||||
bool fast = common_flags()->fast_unwind_on_malloc; \
|
||||
if (fast && (t = CurrentThreadContext())) { \
|
||||
stack_top = t->stack_end(); \
|
||||
stack_bottom = t->stack_begin(); \
|
||||
} \
|
||||
stack.Unwind(__sanitizer::common_flags()->malloc_context_size, \
|
||||
StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), 0, \
|
||||
stack_top, stack_bottom, fast); \
|
||||
}
|
||||
|
||||
#define ENSURE_LSAN_INITED do { \
|
||||
|
|
|
@ -71,7 +71,7 @@ void StackTrace::Unwind(uptr max_depth, uptr pc, uptr bp, void *context,
|
|||
SlowUnwindStackWithContext(pc, context, max_depth);
|
||||
else
|
||||
SlowUnwindStack(pc, max_depth);
|
||||
} else {
|
||||
} else {
|
||||
FastUnwindStack(pc, bp, stack_top, stack_bottom, max_depth);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class FastUnwindTest : public ::testing::Test {
|
|||
bool TryFastUnwind(uptr max_depth) {
|
||||
if (!StackTrace::WillUseFastUnwind(true))
|
||||
return false;
|
||||
trace.Unwind(max_depth, start_pc, (uptr)&fake_stack[0], fake_top,
|
||||
trace.Unwind(max_depth, start_pc, (uptr)&fake_stack[0], 0, fake_top,
|
||||
fake_bottom, true);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue