summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_printf.cc
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2016-01-06 23:15:01 +0000
committerAnna Zaks <ganna@apple.com>2016-01-06 23:15:01 +0000
commit89251b08eb4bd2111bd50c72b947370e06e3acaa (patch)
tree1ed5b627e96a3df96f6a949adc9f0f79726ca583 /lib/sanitizer_common/sanitizer_printf.cc
parent5c2b59ac6e0ba0c26a8cc2fa7983faca30aa25ce (diff)
[sanitizers] Log all output to CrashReport on OS X
Log all of sanitizers' output (not just ASan bug reports) to CrashReport, which simplifies diagnosing failed checks as well as other errors. This also allows to strip the color sequences early from the printed buffer, which is more efficient than what we had perviously. Differential Revision: http://reviews.llvm.org/D15396 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_printf.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_printf.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_printf.cc b/lib/sanitizer_common/sanitizer_printf.cc
index 2794e667e..434ebb93d 100644
--- a/lib/sanitizer_common/sanitizer_printf.cc
+++ b/lib/sanitizer_common/sanitizer_printf.cc
@@ -278,9 +278,12 @@ static void SharedPrintfCode(bool append_pid, const char *format,
# undef CHECK_NEEDED_LENGTH
}
RawWrite(buffer);
- if (common_flags()->log_to_syslog && ShouldLogAfterPrintf())
- WriteToSyslog(buffer);
+
+ // Remove color sequences from the message.
+ RemoveANSIEscapeSequencesFromString(buffer);
CallPrintfAndReportCallback(buffer);
+ LogMessageOnPrintf(buffer);
+
// If we had mapped any memory, clean up.
if (buffer != local_buffer)
UnmapOrDie((void *)buffer, buffer_size);