Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4438)

Unified Diff: build/sanitizers/sanitizer_options.cc

Issue 924923002: Add default options/suppressions for LeakSanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make suppressions file nonempty Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/sanitizers/sanitizer_options.cc
diff --git a/build/sanitizers/sanitizer_options.cc b/build/sanitizers/sanitizer_options.cc
index af78bf855806434a5952861cf81316590be7ce51..b4d17cb35b8d17c4ea64ea42a1b7b1375035015c 100644
--- a/build/sanitizers/sanitizer_options.cc
+++ b/build/sanitizers/sanitizer_options.cc
@@ -143,3 +143,35 @@ const char *__tsan_default_suppressions() {
}
#endif // THREAD_SANITIZER && OS_LINUX
+
+#if defined(LEAK_SANITIZER)
+// Default options for LeakSanitizer:
+// print_suppressions=1 - print the list of matched suppressions.
+// strip_path_prefix=Release/../../ - prefixes up to and including this
+// substring will be stripped from source file paths in symbolized reports.
+const char kLsanDefaultOptions[] =
+ "print_suppressions=1 strip_path_prefix=Release/../../ ";
+
+extern "C"
+__attribute__((no_sanitize_thread))
Alexander Potapenko 2015/02/16 10:29:11 Did you mean __attribute__((no_sanitize_address))
earthdok 2015/02/16 13:39:59 I've refactored this file a bit, ptal.
+__attribute__((visibility("default")))
+// The function isn't referenced from the executable itself. Make sure it isn't
+// stripped by the linker.
+__attribute__((used))
+const char *__lsan_default_options() {
+ return kLsanDefaultOptions;
+}
+
+extern "C" char kLSanDefaultSuppressions[];
+
+extern "C"
+__attribute__((no_sanitize_thread))
+__attribute__((visibility("default")))
+// The function isn't referenced from the executable itself. Make sure it isn't
+// stripped by the linker.
+__attribute__((used))
+const char *__lsan_default_suppressions() {
+ return kLSanDefaultSuppressions;
+}
+
+#endif // LEAK_SANITIZER

Powered by Google App Engine
This is Rietveld 408576698