Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 1 | //===-- asan_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 AddressSanitizer, an address sanity checker. |
| 11 | // |
| 12 | // ASan runtime flags. |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef ASAN_FLAGS_H |
| 16 | #define ASAN_FLAGS_H |
| 17 | |
Evgeniy Stepanov | 250f221 | 2013-01-30 13:12:08 +0000 | [diff] [blame] | 18 | #include "sanitizer_common/sanitizer_internal_defs.h" |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 19 | |
Alexey Samsonov | 36ea94d | 2013-02-19 13:14:48 +0000 | [diff] [blame] | 20 | // ASan flag values can be defined in four ways: |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 21 | // 1) initialized with default values at startup. |
Alexey Samsonov | 36ea94d | 2013-02-19 13:14:48 +0000 | [diff] [blame] | 22 | // 2) overriden during compilation of ASan runtime by providing |
| 23 | // compile definition ASAN_DEFAULT_OPTIONS. |
| 24 | // 3) overriden from string returned by user-specified function |
Alexey Samsonov | b750c4c | 2012-07-25 10:40:57 +0000 | [diff] [blame] | 25 | // __asan_default_options(). |
Alexey Samsonov | 36ea94d | 2013-02-19 13:14:48 +0000 | [diff] [blame] | 26 | // 4) overriden from env variable ASAN_OPTIONS. |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 27 | |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 28 | namespace __asan { |
| 29 | |
| 30 | struct Flags { |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 31 | // Flag descriptions are in asan_rtl.cc. |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 32 | int quarantine_size; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 33 | int redzone; |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 34 | int max_redzone; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 35 | bool debug; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 36 | int report_globals; |
Kostya Serebryany | 3945c58 | 2012-08-21 14:10:25 +0000 | [diff] [blame] | 37 | bool check_initialization_order; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 38 | bool replace_str; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 39 | bool replace_intrin; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 40 | bool mac_ignore_invalid_free; |
Kostya Serebryany | 230e52f | 2013-09-18 10:35:12 +0000 | [diff] [blame] | 41 | bool detect_stack_use_after_return; |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 42 | int min_uar_stack_size_log; |
| 43 | int max_uar_stack_size_log; |
| 44 | bool uar_noreserve; |
Kostya Serebryany | 2a3619e | 2013-04-04 11:17:14 +0000 | [diff] [blame] | 45 | int max_malloc_fill_size, malloc_fill_byte; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 46 | int exitcode; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 47 | bool allow_user_poisoning; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 48 | int sleep_before_dying; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 49 | bool check_malloc_usable_size; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 50 | bool unmap_shadow_on_exit; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 51 | bool abort_on_error; |
Kostya Serebryany | 95f630a | 2013-01-28 07:34:22 +0000 | [diff] [blame] | 52 | bool print_stats; |
Kostya Serebryany | 95f630a | 2013-01-28 07:34:22 +0000 | [diff] [blame] | 53 | bool print_legend; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 54 | bool atexit; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 55 | bool disable_core; |
Alexander Potapenko | eb8c46e | 2012-08-24 09:22:05 +0000 | [diff] [blame] | 56 | bool allow_reexec; |
Alexey Samsonov | 71b42c9 | 2012-09-05 07:37:15 +0000 | [diff] [blame] | 57 | bool print_full_thread_history; |
Kostya Serebryany | 73bad81 | 2012-12-20 11:54:21 +0000 | [diff] [blame] | 58 | bool poison_heap; |
Kostya Serebryany | cca8e78 | 2013-10-16 13:49:01 +0000 | [diff] [blame] | 59 | bool poison_partial; |
Kostya Serebryany | fe6d916 | 2012-12-21 08:53:59 +0000 | [diff] [blame] | 60 | bool alloc_dealloc_mismatch; |
Alexander Potapenko | 8bd5e74 | 2013-02-28 14:09:30 +0000 | [diff] [blame] | 61 | bool strict_memcmp; |
Alexey Samsonov | dfeef67 | 2013-04-19 08:35:16 +0000 | [diff] [blame] | 62 | bool strict_init_order; |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 63 | bool start_deactivated; |
| 64 | int detect_invalid_pointer_pairs; |
| 65 | bool detect_container_overflow; |
| 66 | int detect_odr_violation; |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 67 | }; |
Alexander Potapenko | 8a1dd56 | 2012-07-25 09:18:43 +0000 | [diff] [blame] | 68 | |
Kostya Serebryany | 16cc10d | 2013-04-11 18:36:04 +0000 | [diff] [blame] | 69 | extern Flags asan_flags_dont_use_directly; |
| 70 | inline Flags *flags() { |
| 71 | return &asan_flags_dont_use_directly; |
| 72 | } |
Alexey Samsonov | 7ed1d2b | 2012-07-10 07:41:27 +0000 | [diff] [blame] | 73 | void InitializeFlags(Flags *f, const char *env); |
| 74 | |
| 75 | } // namespace __asan |
| 76 | |
| 77 | #endif // ASAN_FLAGS_H |