forked from OSchip/llvm-project
[msan] Use slow stack unwinder in UMR reports.
llvm-svn: 175510
This commit is contained in:
parent
f940f0c417
commit
76dc3a81ea
|
@ -151,7 +151,11 @@ static void GetCurrentStackBounds(uptr *stack_top, uptr *stack_bottom) {
|
|||
*stack_bottom = __msan_stack_bounds.stack_bottom;
|
||||
}
|
||||
|
||||
void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp) {
|
||||
void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp,
|
||||
bool fast) {
|
||||
if (!fast)
|
||||
return stack->SlowUnwindStack(pc, max_s);
|
||||
|
||||
uptr stack_top, stack_bottom;
|
||||
GetCurrentStackBounds(&stack_top, &stack_bottom);
|
||||
stack->size = 0;
|
||||
|
@ -179,7 +183,7 @@ void PrintWarningWithOrigin(uptr pc, uptr bp, u32 origin) {
|
|||
++msan_report_count;
|
||||
|
||||
StackTrace stack;
|
||||
GetStackTrace(&stack, kStackTraceMax, pc, bp);
|
||||
GetStackTrace(&stack, kStackTraceMax, pc, bp, /*fast*/false);
|
||||
|
||||
u32 report_origin =
|
||||
(__msan_track_origins && OriginIsValid(origin)) ? origin : 0;
|
||||
|
@ -277,7 +281,7 @@ void __msan_set_expect_umr(int expect_umr) {
|
|||
GET_CALLER_PC_BP_SP;
|
||||
(void)sp;
|
||||
StackTrace stack;
|
||||
GetStackTrace(&stack, kStackTraceMax, pc, bp);
|
||||
GetStackTrace(&stack, kStackTraceMax, pc, bp, /*fast*/false);
|
||||
ReportExpectedUMRNotFound(&stack);
|
||||
Die();
|
||||
}
|
||||
|
|
|
@ -54,7 +54,8 @@ void MsanDie();
|
|||
void PrintWarning(uptr pc, uptr bp);
|
||||
void PrintWarningWithOrigin(uptr pc, uptr bp, u32 origin);
|
||||
|
||||
void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp);
|
||||
void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp,
|
||||
bool fast);
|
||||
|
||||
void ReportUMR(StackTrace *stack, u32 origin);
|
||||
void ReportExpectedUMRNotFound(StackTrace *stack);
|
||||
|
@ -65,7 +66,8 @@ void ReportAtExitStatistics();
|
|||
stack.size = 0; \
|
||||
if (__msan_get_track_origins() && msan_inited) \
|
||||
GetStackTrace(&stack, flags()->num_callers, \
|
||||
StackTrace::GetCurrentPc(), GET_CURRENT_FRAME())
|
||||
StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \
|
||||
/* fast */ true)
|
||||
|
||||
} // namespace __msan
|
||||
|
||||
|
|
Loading…
Reference in New Issue