[compiler-rt] r175510 - [msan] Use slow stack unwinder in UMR reports.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Tue Feb 19 04:43:19 PST 2013
Author: eugenis
Date: Tue Feb 19 06:43:18 2013
New Revision: 175510
URL: http://llvm.org/viewvc/llvm-project?rev=175510&view=rev
Log:
[msan] Use slow stack unwinder in UMR reports.
Modified:
compiler-rt/trunk/lib/msan/msan.cc
compiler-rt/trunk/lib/msan/msan.h
Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=175510&r1=175509&r2=175510&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Tue Feb 19 06:43:18 2013
@@ -151,7 +151,11 @@ static void GetCurrentStackBounds(uptr *
*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, upt
++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_um
GET_CALLER_PC_BP_SP;
(void)sp;
StackTrace stack;
- GetStackTrace(&stack, kStackTraceMax, pc, bp);
+ GetStackTrace(&stack, kStackTraceMax, pc, bp, /*fast*/false);
ReportExpectedUMRNotFound(&stack);
Die();
}
Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=175510&r1=175509&r2=175510&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Tue Feb 19 06:43:18 2013
@@ -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
More information about the llvm-commits
mailing list