Alexey Samsonov | f3be706 | 2012-07-09 13:21:39 +0000 | [diff] [blame] | 1 | //===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file is a part of ThreadSanitizer/AddressSanitizer runtime. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef SANITIZER_FLAGS_H |
| 15 | #define SANITIZER_FLAGS_H |
| 16 | |
Alexey Samsonov | 9b1b101 | 2012-07-10 09:17:06 +0000 | [diff] [blame] | 17 | #include "sanitizer_internal_defs.h" |
Alexey Samsonov | f3be706 | 2012-07-09 13:21:39 +0000 | [diff] [blame] | 18 | |
| 19 | namespace __sanitizer { |
| 20 | |
| 21 | void ParseFlag(const char *env, bool *flag, const char *name); |
| 22 | void ParseFlag(const char *env, int *flag, const char *name); |
| 23 | void ParseFlag(const char *env, const char **flag, const char *name); |
| 24 | |
Sergey Matveev | ed20ebe | 2013-05-06 11:27:58 +0000 | [diff] [blame] | 25 | struct CommonFlags { |
| 26 | // If set, use the online symbolizer from common sanitizer runtime. |
| 27 | bool symbolize; |
| 28 | // Path to external symbolizer. |
| 29 | const char *external_symbolizer_path; |
| 30 | // Strips this prefix from file paths in error reports. |
| 31 | const char *strip_path_prefix; |
| 32 | // Use fast (frame-pointer-based) unwinder on fatal errors (if available). |
| 33 | bool fast_unwind_on_fatal; |
| 34 | // Use fast (frame-pointer-based) unwinder on malloc/free (if available). |
| 35 | bool fast_unwind_on_malloc; |
Evgeniy Stepanov | 745dd0d | 2013-06-07 13:00:47 +0000 | [diff] [blame] | 36 | // Intercept and handle ioctl requests. |
| 37 | bool handle_ioctl; |
Sergey Matveev | ed20ebe | 2013-05-06 11:27:58 +0000 | [diff] [blame] | 38 | // Max number of stack frames kept for each allocation/deallocation. |
| 39 | int malloc_context_size; |
Evgeniy Stepanov | b624606 | 2013-06-25 13:50:44 +0000 | [diff] [blame] | 40 | // Write logs to "log_path.pid" instead of stderr. |
| 41 | const char *log_path; |
Sergey Matveev | ed20ebe | 2013-05-06 11:27:58 +0000 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | extern CommonFlags common_flags_dont_use_directly; |
| 45 | |
| 46 | inline CommonFlags *common_flags() { |
| 47 | return &common_flags_dont_use_directly; |
| 48 | } |
| 49 | |
| 50 | void ParseCommonFlagsFromString(const char *str); |
| 51 | |
Alexey Samsonov | f3be706 | 2012-07-09 13:21:39 +0000 | [diff] [blame] | 52 | } // namespace __sanitizer |
| 53 | |
| 54 | #endif // SANITIZER_FLAGS_H |