[PATCH] D68603: [sanitizer] Print SIGTRAP for corresponding signal
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 7 15:17:48 PDT 2019
vitalybuka created this revision.
vitalybuka added a reviewer: eugenis.
Herald added a reviewer: jfb.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D68603
Files:
compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp
Index: compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp
===================================================================
--- /dev/null
+++ compiler-rt/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: SIGTRAP on unknown address
Index: compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
@@ -312,6 +312,8 @@
return "SEGV";
case SIGBUS:
return "BUS";
+ case SIGTRAP:
+ return "SIGTRAP";
}
return "UNKNOWN SIGNAL";
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68603.223674.patch
Type: text/x-patch
Size: 872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191007/20b47c7a/attachment.bin>
More information about the llvm-commits
mailing list