summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_flags.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_flags.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc
index d0e7d54a6db..ba23ea04bc2 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc
@@ -18,16 +18,31 @@
namespace __sanitizer {
+void SetCommonFlagDefaults() {
+ CommonFlags *f = common_flags();
+ f->symbolize = true;
+ f->external_symbolizer_path = "";
+ f->strip_path_prefix = "";
+ f->fast_unwind_on_fatal = false;
+ f->fast_unwind_on_malloc = true;
+ f->handle_ioctl = false;
+ f->malloc_context_size = 1;
+ f->log_path = "stderr";
+ f->verbosity = 0;
+ f->detect_leaks = false;
+ f->leak_check_at_exit = true;
+ f->allocator_may_return_null = false;
+}
+
void ParseCommonFlagsFromString(const char *str) {
CommonFlags *f = common_flags();
ParseFlag(str, &f->symbolize, "symbolize");
ParseFlag(str, &f->external_symbolizer_path, "external_symbolizer_path");
- ParseFlag(str, &f->malloc_context_size, "malloc_context_size");
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");
- ParseFlag(str, &f->symbolize, "symbolize");
ParseFlag(str, &f->handle_ioctl, "handle_ioctl");
+ ParseFlag(str, &f->malloc_context_size, "malloc_context_size");
ParseFlag(str, &f->log_path, "log_path");
ParseFlag(str, &f->verbosity, "verbosity");
ParseFlag(str, &f->detect_leaks, "detect_leaks");
OpenPOWER on IntegriCloud