浏览代码

LibSanitizer: Log UBSAN errors in red text to the debug console

This makes them harder to miss for spammy apps when UBSAN is not deadly.

Don't commit to making the warnln red at the momment, because that would
probably be a nuisance if stderr is not a tty.
Andrew Kaster 3 年之前
父节点
当前提交
7e04160b0b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibSanitizer/UBSanitizer.cpp

+ 1 - 1
Userland/Libraries/LibSanitizer/UBSanitizer.cpp

@@ -13,7 +13,7 @@ bool AK::UBSanitizer::g_ubsan_is_deadly { false };
 
 
 #define WARNLN_AND_DBGLN(fmt, ...) \
 #define WARNLN_AND_DBGLN(fmt, ...) \
     warnln(fmt, ##__VA_ARGS__);    \
     warnln(fmt, ##__VA_ARGS__);    \
-    dbgln(fmt, ##__VA_ARGS__);
+    dbgln("\x1B[31m" fmt "\x1B[0m", ##__VA_ARGS__);
 
 
 extern "C" {
 extern "C" {