From 10286e1e591d5d047d822a687a17851cf14b1aa0 Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Fri, 16 Aug 2013 11:26:26 +0000 Subject: [PATCH] [ASan/RTL] Disable colored reporting on Windows llvm-svn: 188545 --- compiler-rt/lib/asan/asan_report.cc | 5 +++++ compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/compiler-rt/lib/asan/asan_report.cc b/compiler-rt/lib/asan/asan_report.cc index f5c67f1..d6d7d9c 100644 --- a/compiler-rt/lib/asan/asan_report.cc +++ b/compiler-rt/lib/asan/asan_report.cc @@ -45,6 +45,11 @@ void AppendToErrorMessageBuffer(const char *buffer) { // ---------------------- Decorator ------------------------------ {{{1 bool PrintsToTtyCached() { + // FIXME: Add proper Windows support to AnsiColorDecorator and re-enable color + // printing on Windows. + if (SANITIZER_WINDOWS) + return 0; + static int cached = 0; static bool prints_to_tty; if (!cached) { // Ok wrt threads since we are printing only from one thread. diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h b/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h index 49334d5..eef2b15 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h @@ -19,6 +19,8 @@ namespace __sanitizer { class AnsiColorDecorator { + // FIXME: This is not portable. It assumes the special strings are printed to + // stdout, which is not the case on Windows (see SetConsoleTextAttribute()). public: explicit AnsiColorDecorator(bool use_ansi_colors) : ansi_(use_ansi_colors) { } const char *Bold() const { return ansi_ ? "\033[1m" : ""; } -- 2.7.4