[PATCH] D68603: [sanitizer] Print SIGTRAP for corresponding signal

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 22:22:22 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL373979: [sanitizer] Print SIGTRAP for corresponding signal (authored by vitalybuka, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D68603?vs=223681&id=223767#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68603/new/

https://reviews.llvm.org/D68603

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cpp
  compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap.cpp


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cpp
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cpp
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cpp
@@ -312,6 +312,8 @@
       return "SEGV";
     case SIGBUS:
       return "BUS";
+    case SIGTRAP:
+      return "TRAP";
   }
   return "UNKNOWN SIGNAL";
 }
Index: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap.cpp
===================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap.cpp
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap.cpp
@@ -0,0 +1,8 @@
+// RUN: %clangxx -O1 %s -o %t && %env_tool_opts=handle_sigtrap=2 not %run %t 2>&1 | FileCheck %s
+
+int main() {
+  __builtin_debugtrap();
+}
+
+// CHECK: Sanitizer:DEADLYSIGNAL
+// CHECK: Sanitizer: TRAP on unknown address


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68603.223767.patch
Type: text/x-patch
Size: 958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191008/729052fa/attachment.bin>


More information about the llvm-commits mailing list