File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
test/sanitizer_common/TestCases/FreeBSD Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -2262,6 +2262,18 @@ void SignalContext::DumpAllRegisters(void *context) {
22622262 Printf (" r14 = 0x%016llx " , ucontext->uc_mcontext .mc_r14 );
22632263 Printf (" r15 = 0x%016llx " , ucontext->uc_mcontext .mc_r15 );
22642264 Printf (" \n " );
2265+ # elif defined(__i386__)
2266+ Report (" Register values:\n " );
2267+ Printf (" eax = 0x%08x " , ucontext->uc_mcontext .mc_eax );
2268+ Printf (" ebx = 0x%08x " , ucontext->uc_mcontext .mc_ebx );
2269+ Printf (" ecx = 0x%08x " , ucontext->uc_mcontext .mc_ecx );
2270+ Printf (" edx = 0x%08x " , ucontext->uc_mcontext .mc_edx );
2271+ Printf (" \n " );
2272+ Printf (" edi = 0x%08x " , ucontext->uc_mcontext .mc_edi );
2273+ Printf (" esi = 0x%08x " , ucontext->uc_mcontext .mc_esi );
2274+ Printf (" ebp = 0x%08x " , ucontext->uc_mcontext .mc_ebp );
2275+ Printf (" esp = 0x%08x " , ucontext->uc_mcontext .mc_esp );
2276+ Printf (" \n " );
22652277# else
22662278 (void )ucontext;
22672279# endif
Original file line number Diff line number Diff line change 1+ // Check that sanitizer prints registers dump_registers on dump_registers=1
2+ // RUN: %clangxx %s -o %t
3+ // RUN: %env_tool_opts=dump_registers=0 not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-NODUMP --strict-whitespace
4+ // RUN: not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-DUMP --strict-whitespace
5+ //
6+ // REQUIRES: i386-target-arch
7+
8+ #include < signal.h>
9+
10+ int main () {
11+ raise (SIGSEGV);
12+ // CHECK-DUMP: Register values
13+ // CHECK-DUMP-NEXT: eax = {{0x[0-9a-f]+}} ebx = {{0x[0-9a-f]+}} ecx = {{0x[0-9a-f]+}} edx = {{0x[0-9a-f]+}}
14+ // CHECK-DUMP-NEXT: edi = {{0x[0-9a-f]+}} esi = {{0x[0-9a-f]+}} ebp = {{0x[0-9a-f]+}} esp = {{0x[0-9a-f]+}}
15+ // CHECK-NODUMP-NOT: Register values
16+ return 0 ;
17+ }
You can’t perform that action at this time.
0 commit comments