[sanitizer] Print SIGTRAP for corresponding signal

Reviewers: eugenis, jfb

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D68603

llvm-svn: 373979
This commit is contained in:
Vitaly Buka 2019-10-07 22:43:19 +00:00
parent 87dd968849
commit 9917c76107
2 changed files with 10 additions and 0 deletions

View File

@ -312,6 +312,8 @@ const char *SignalContext::Describe() const {
return "SEGV";
case SIGBUS:
return "BUS";
case SIGTRAP:
return "TRAP";
}
return "UNKNOWN SIGNAL";
}

View File

@ -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