1 //===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of ThreadSanitizer/AddressSanitizer runtime.
10 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_FLAGS_H
13 #define SANITIZER_FLAGS_H
15 #include "sanitizer_internal_defs.h"
17 namespace __sanitizer
{
19 void ParseFlag(const char *env
, bool *flag
, const char *name
);
20 void ParseFlag(const char *env
, int *flag
, const char *name
);
21 void ParseFlag(const char *env
, const char **flag
, const char *name
);
24 // If set, use the online symbolizer from common sanitizer runtime.
26 // Path to external symbolizer. If it is NULL, symbolizer will be looked for
27 // in PATH. If it is empty, external symbolizer will not be started.
28 const char *external_symbolizer_path
;
29 // Strips this prefix from file paths in error reports.
30 const char *strip_path_prefix
;
31 // Use fast (frame-pointer-based) unwinder on fatal errors (if available).
32 bool fast_unwind_on_fatal
;
33 // Use fast (frame-pointer-based) unwinder on malloc/free (if available).
34 bool fast_unwind_on_malloc
;
35 // Intercept and handle ioctl requests.
37 // Max number of stack frames kept for each allocation/deallocation.
38 int malloc_context_size
;
39 // Write logs to "log_path.pid".
40 // The special values are "stdout" and "stderr".
41 // The default is "stderr".
43 // Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).
45 // Enable memory leak detection.
47 // Invoke leak checking in an atexit handler. Has no effect if
48 // detect_leaks=false, or if __lsan_do_leak_check() is called before the
49 // handler has a chance to run.
50 bool leak_check_at_exit
;
51 // If false, the allocator will crash instead of returning 0 on out-of-memory.
52 bool allocator_may_return_null
;
53 // If false, disable printing error summaries in addition to error reports.
57 inline CommonFlags
*common_flags() {
62 void SetCommonFlagsDefaults(CommonFlags
*f
);
63 void ParseCommonFlagsFromString(CommonFlags
*f
, const char *str
);
65 } // namespace __sanitizer
67 #endif // SANITIZER_FLAGS_H