diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-06-27 12:48:01 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-06-27 12:48:01 +0000 |
commit | 825627d1ee7572056af55f5c22b96cb815cc59b6 (patch) | |
tree | dd444f6bf7db953b4b642e16cba1a87d7a3fad48 /lib/msan | |
parent | 921cb54eeb05077dc3a9019ab10ae3518cc9a208 (diff) |
[msan] Add store_context_size= flag.
A new flag to control stack trace size for store event (in
track-origins=2 mode) independently of malloc_context_size.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan')
-rw-r--r-- | lib/msan/msan.cc | 3 | ||||
-rw-r--r-- | lib/msan/msan.h | 12 | ||||
-rw-r--r-- | lib/msan/msan_flags.h | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/lib/msan/msan.cc b/lib/msan/msan.cc index 58a5af43c..6d681b19e 100644 --- a/lib/msan/msan.cc +++ b/lib/msan/msan.cc @@ -145,6 +145,8 @@ static void ParseFlagsFromString(Flags *f, const char *str) { ParseFlag(str, &f->wrap_signals, "wrap_signals", ""); ParseFlag(str, &f->print_stats, "print_stats", ""); ParseFlag(str, &f->atexit, "atexit", ""); + ParseFlag(str, &f->store_context_size, "store_context_size", ""); + if (f->store_context_size < 1) f->store_context_size = 1; // keep_going is an old name for halt_on_error, // and it has inverse meaning. @@ -177,6 +179,7 @@ static void InitializeFlags(Flags *f, const char *options) { f->print_stats = false; f->atexit = false; f->halt_on_error = !&__msan_keep_going; + f->store_context_size = 20; // Override from user-specified string. if (__msan_default_options) diff --git a/lib/msan/msan.h b/lib/msan/msan.h index 2105791a0..f8b79a7d1 100644 --- a/lib/msan/msan.h +++ b/lib/msan/msan.h @@ -104,12 +104,12 @@ u32 ChainOrigin(u32 id, StackTrace *stack); StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ common_flags()->fast_unwind_on_malloc) -#define GET_STORE_STACK_TRACE_PC_BP(pc, bp) \ - StackTrace stack; \ - stack.size = 0; \ - if (__msan_get_track_origins() > 1 && msan_inited) \ - GetStackTrace(&stack, common_flags()->malloc_context_size, pc, bp, \ - common_flags()->fast_unwind_on_malloc) +#define GET_STORE_STACK_TRACE_PC_BP(pc, bp) \ + StackTrace stack; \ + stack.size = 0; \ + if (__msan_get_track_origins() > 1 && msan_inited) \ + GetStackTrace(&stack, flags()->store_context_size, pc, bp, \ + common_flags()->fast_unwind_on_malloc) #define GET_FATAL_STACK_TRACE_PC_BP(pc, bp) \ StackTrace stack; \ diff --git a/lib/msan/msan_flags.h b/lib/msan/msan_flags.h index e9ea32bda..9b93f118a 100644 --- a/lib/msan/msan_flags.h +++ b/lib/msan/msan_flags.h @@ -30,6 +30,7 @@ struct Flags { bool print_stats; bool halt_on_error; bool atexit; + int store_context_size; // like malloc_context_size, but for uninit stores }; Flags *flags(); |