diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-06 18:43:45 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-06 18:43:45 +0000 |
| commit | fbaaed6b581a3d08b16f0a247e32e98398d014ea (patch) | |
| tree | 939760282397ae02e47cd1a63ded2ab144f1cd00 /compiler-rt/lib/sanitizer_common/sanitizer_flags.cc | |
| parent | e6352e47975a8b90d090c0243241e56027c0caf1 (diff) | |
| download | bcm5719-llvm-fbaaed6b581a3d08b16f0a247e32e98398d014ea.tar.gz bcm5719-llvm-fbaaed6b581a3d08b16f0a247e32e98398d014ea.zip | |
[Sanitizer] Introduce "stack_trace_format" runtime flag.
This flag can be used to specify the format of stack frames - user
can now provide a string with placeholders, which should be printed
for each stack frame with placeholders replaced with actual data.
For example "%p" will be replaced by PC, "%s" will be replaced by
the source file name etc.
"DEFAULT" value enforces default stack trace format currently used in
all the sanitizers except TSan.
This change also implements __sanitizer_print_stack_trace interface
function in TSan.
llvm-svn: 221469
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_flags.cc')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_flags.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc index 55644e0d69f..40b6ec06715 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc @@ -68,6 +68,7 @@ void SetCommonFlagsDefaults(CommonFlags *f) { f->print_suppressions = true; f->disable_coredump = (SANITIZER_WORDSIZE == 64); f->symbolize_inline_frames = true; + f->stack_trace_format = "DEFAULT"; } void ParseCommonFlagsFromString(CommonFlags *f, const char *str) { @@ -161,6 +162,10 @@ void ParseCommonFlagsFromString(CommonFlags *f, const char *str) { "default and for sanitizers that don't reserve lots of virtual memory."); ParseFlag(str, &f->symbolize_inline_frames, "symbolize_inline_frames", "Print inlined frames in stacktraces. Defaults to true."); + ParseFlag(str, &f->stack_trace_format, "stack_trace_format", + "Format string used to render stack frames. " + "See sanitizer_stacktrace_printer.h for the format description. " + "Use DEFAULT to get default format."); // Do a sanity check for certain flags. if (f->malloc_context_size < 1) |

