OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains the default options for various compiler-based dynamic | 5 // This file contains the default options for various compiler-based dynamic |
6 // tools. | 6 // tools. |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) | 10 #if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 int argc = *argcp; | 94 int argc = *argcp; |
95 for (int i = 0; i < argc; ++i) { | 95 for (int i = 0; i < argc; ++i) { |
96 if (strcmp(argv[i], kNaClFlag) == 0) { | 96 if (strcmp(argv[i], kNaClFlag) == 0) { |
97 return kNaClDefaultOptions; | 97 return kNaClDefaultOptions; |
98 } | 98 } |
99 } | 99 } |
100 #endif | 100 #endif |
101 return kAsanDefaultOptions; | 101 return kAsanDefaultOptions; |
102 } | 102 } |
103 | 103 |
104 extern "C" char kASanDefaultSuppressions[]; | 104 extern char kASanDefaultSuppressions[]; |
105 | 105 |
106 SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_suppressions() { | 106 SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_suppressions() { |
107 return kASanDefaultSuppressions; | 107 return kASanDefaultSuppressions; |
108 } | 108 } |
109 #endif // OS_LINUX || OS_MACOSX | 109 #endif // OS_LINUX || OS_MACOSX |
110 #endif // ADDRESS_SANITIZER | 110 #endif // ADDRESS_SANITIZER |
111 | 111 |
112 #if defined(THREAD_SANITIZER) && defined(OS_LINUX) | 112 #if defined(THREAD_SANITIZER) && defined(OS_LINUX) |
113 // Default options for ThreadSanitizer in various configurations: | 113 // Default options for ThreadSanitizer in various configurations: |
114 // detect_deadlocks=1 - enable deadlock (lock inversion) detection. | 114 // detect_deadlocks=1 - enable deadlock (lock inversion) detection. |
115 // second_deadlock_stack=1 - more verbose deadlock reports. | 115 // second_deadlock_stack=1 - more verbose deadlock reports. |
116 // report_signal_unsafe=0 - do not report async-signal-unsafe functions | 116 // report_signal_unsafe=0 - do not report async-signal-unsafe functions |
117 // called from signal handlers. | 117 // called from signal handlers. |
118 // report_thread_leaks=0 - do not report unjoined threads at the end of | 118 // report_thread_leaks=0 - do not report unjoined threads at the end of |
119 // the program execution. | 119 // the program execution. |
120 // print_suppressions=1 - print the list of matched suppressions. | 120 // print_suppressions=1 - print the list of matched suppressions. |
121 // history_size=7 - make the history buffer proportional to 2^7 (the maximum | 121 // history_size=7 - make the history buffer proportional to 2^7 (the maximum |
122 // value) to keep more stack traces. | 122 // value) to keep more stack traces. |
123 // strip_path_prefix=/../../ - prefixes up to and including this | 123 // strip_path_prefix=/../../ - prefixes up to and including this |
124 // substring will be stripped from source file paths in symbolized reports. | 124 // substring will be stripped from source file paths in symbolized reports. |
125 const char kTsanDefaultOptions[] = | 125 const char kTsanDefaultOptions[] = |
126 "detect_deadlocks=1 second_deadlock_stack=1 report_signal_unsafe=0 " | 126 "detect_deadlocks=1 second_deadlock_stack=1 report_signal_unsafe=0 " |
127 "report_thread_leaks=0 print_suppressions=1 history_size=7 " | 127 "report_thread_leaks=0 print_suppressions=1 history_size=7 " |
128 "strict_memcmp=0 strip_path_prefix=/../../ "; | 128 "strict_memcmp=0 strip_path_prefix=/../../ "; |
129 | 129 |
130 SANITIZER_HOOK_ATTRIBUTE const char *__tsan_default_options() { | 130 SANITIZER_HOOK_ATTRIBUTE const char *__tsan_default_options() { |
131 return kTsanDefaultOptions; | 131 return kTsanDefaultOptions; |
132 } | 132 } |
133 | 133 |
134 extern "C" char kTSanDefaultSuppressions[]; | 134 extern char kTSanDefaultSuppressions[]; |
135 | 135 |
136 SANITIZER_HOOK_ATTRIBUTE const char *__tsan_default_suppressions() { | 136 SANITIZER_HOOK_ATTRIBUTE const char *__tsan_default_suppressions() { |
137 return kTSanDefaultSuppressions; | 137 return kTSanDefaultSuppressions; |
138 } | 138 } |
139 | 139 |
140 #endif // THREAD_SANITIZER && OS_LINUX | 140 #endif // THREAD_SANITIZER && OS_LINUX |
141 | 141 |
142 #if defined(MEMORY_SANITIZER) | 142 #if defined(MEMORY_SANITIZER) |
143 // Default options for MemorySanitizer: | 143 // Default options for MemorySanitizer: |
144 // intercept_memcmp=0 - do not detect uninitialized memory in memcmp() calls. | 144 // intercept_memcmp=0 - do not detect uninitialized memory in memcmp() calls. |
(...skipping 14 matching lines...) Expand all Loading... |
159 // print_suppressions=1 - print the list of matched suppressions. | 159 // print_suppressions=1 - print the list of matched suppressions. |
160 // strip_path_prefix=/../../ - prefixes up to and including this | 160 // strip_path_prefix=/../../ - prefixes up to and including this |
161 // substring will be stripped from source file paths in symbolized reports. | 161 // substring will be stripped from source file paths in symbolized reports. |
162 const char kLsanDefaultOptions[] = | 162 const char kLsanDefaultOptions[] = |
163 "print_suppressions=1 strip_path_prefix=/../../ "; | 163 "print_suppressions=1 strip_path_prefix=/../../ "; |
164 | 164 |
165 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_options() { | 165 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_options() { |
166 return kLsanDefaultOptions; | 166 return kLsanDefaultOptions; |
167 } | 167 } |
168 | 168 |
169 extern "C" char kLSanDefaultSuppressions[]; | 169 extern char kLSanDefaultSuppressions[]; |
170 | 170 |
171 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { | 171 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { |
172 return kLSanDefaultSuppressions; | 172 return kLSanDefaultSuppressions; |
173 } | 173 } |
174 | 174 |
175 #endif // LEAK_SANITIZER | 175 #endif // LEAK_SANITIZER |
176 | 176 |
177 #if defined(UNDEFINED_SANITIZER) | 177 #if defined(UNDEFINED_SANITIZER) |
178 // Default options for UndefinedBehaviorSanitizer: | 178 // Default options for UndefinedBehaviorSanitizer: |
179 // print_stacktrace=1 - print the stacktrace when UBSan reports an error. | 179 // print_stacktrace=1 - print the stacktrace when UBSan reports an error. |
180 const char kUbsanDefaultOptions[] = | 180 const char kUbsanDefaultOptions[] = |
181 "print_stacktrace=1 strip_path_prefix=/../../ "; | 181 "print_stacktrace=1 strip_path_prefix=/../../ "; |
182 | 182 |
183 SANITIZER_HOOK_ATTRIBUTE const char* __ubsan_default_options() { | 183 SANITIZER_HOOK_ATTRIBUTE const char* __ubsan_default_options() { |
184 return kUbsanDefaultOptions; | 184 return kUbsanDefaultOptions; |
185 } | 185 } |
186 | 186 |
187 #endif // UNDEFINED_SANITIZER | 187 #endif // UNDEFINED_SANITIZER |
OLD | NEW |