[compiler-rt] r177057 - [msan] Options for switching between fast and cfi unwinders in run time.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Mar 14 04:47:03 PDT 2013
Author: eugenis
Date: Thu Mar 14 06:47:03 2013
New Revision: 177057
URL: http://llvm.org/viewvc/llvm-project?rev=177057&view=rev
Log:
[msan] Options for switching between fast and cfi unwinders in run time.
Does not change default behavior.
Modified:
compiler-rt/trunk/lib/msan/msan.cc
compiler-rt/trunk/lib/msan/msan.h
compiler-rt/trunk/lib/msan/msan_flags.h
Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=177057&r1=177056&r2=177057&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Thu Mar 14 06:47:03 2013
@@ -127,6 +127,8 @@ static void ParseFlagsFromString(Flags *
ParseFlag(str, &f->report_umrs, "report_umrs");
ParseFlag(str, &f->verbosity, "verbosity");
ParseFlag(str, &f->strip_path_prefix, "strip_path_prefix");
+ ParseFlag(str, &f->fast_unwind_on_fatal, "fast_unwind_on_fatal");
+ ParseFlag(str, &f->fast_unwind_on_malloc, "fast_unwind_on_malloc");
}
static void InitializeFlags(Flags *f, const char *options) {
@@ -140,6 +142,8 @@ static void InitializeFlags(Flags *f, co
f->report_umrs = true;
f->verbosity = 0;
f->strip_path_prefix = "";
+ f->fast_unwind_on_fatal = false;
+ f->fast_unwind_on_malloc = true;
// Override from user-specified string.
if (__msan_default_options)
@@ -195,7 +199,7 @@ void PrintWarningWithOrigin(uptr pc, upt
++msan_report_count;
StackTrace stack;
- GetStackTrace(&stack, kStackTraceMax, pc, bp, /*fast*/false);
+ GetStackTrace(&stack, kStackTraceMax, pc, bp, flags()->fast_unwind_on_fatal);
u32 report_origin =
(__msan_track_origins && OriginIsValid(origin)) ? origin : 0;
@@ -294,7 +298,8 @@ void __msan_set_expect_umr(int expect_um
GET_CALLER_PC_BP_SP;
(void)sp;
StackTrace stack;
- GetStackTrace(&stack, kStackTraceMax, pc, bp, /*fast*/false);
+ GetStackTrace(&stack, kStackTraceMax, pc, bp,
+ flags()->fast_unwind_on_fatal);
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=177057&r1=177056&r2=177057&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Thu Mar 14 06:47:03 2013
@@ -79,7 +79,7 @@ void UnpoisonMappedDSO(struct link_map *
if (__msan_get_track_origins() && msan_inited) \
GetStackTrace(&stack, flags()->num_callers, \
StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \
- /* fast */ true)
+ flags()->fast_unwind_on_malloc)
} // namespace __msan
Modified: compiler-rt/trunk/lib/msan/msan_flags.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_flags.h?rev=177057&r1=177056&r2=177057&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_flags.h (original)
+++ compiler-rt/trunk/lib/msan/msan_flags.h Thu Mar 14 06:47:03 2013
@@ -26,6 +26,10 @@ struct Flags {
bool poison_in_malloc; // default: true
bool report_umrs;
const char *strip_path_prefix;
+ // Use fast (frame-pointer-based) unwinder on fatal errors (if available).
+ bool fast_unwind_on_fatal;
+ // Use fast (frame-pointer-based) unwinder on malloc/free (if available).
+ bool fast_unwind_on_malloc;
};
Flags *flags();
More information about the llvm-commits
mailing list