diff options
author | Marcin Koscielnicki <koriakin@0x04.net> | 2016-04-26 10:41:30 +0000 |
---|---|---|
committer | Marcin Koscielnicki <koriakin@0x04.net> | 2016-04-26 10:41:30 +0000 |
commit | 3eab866284380b5e189b889d6d2f2513cd2758ef (patch) | |
tree | d65ab594cbd1ad1032729632c09c30c9e4597c50 /test | |
parent | 8bb157791abf8514424190745c52839e5e741cf2 (diff) |
[sanitizer] [SystemZ] Add ptrace support bits.
Differential Revision: http://reviews.llvm.org/D19134
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/asan/TestCases/Linux/ptrace.cc | 7 | ||||
-rw-r--r-- | test/sanitizer_common/TestCases/Linux/ptrace.cc | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/asan/TestCases/Linux/ptrace.cc b/test/asan/TestCases/Linux/ptrace.cc index d87d90be4..bd3d2d27e 100644 --- a/test/asan/TestCases/Linux/ptrace.cc +++ b/test/asan/TestCases/Linux/ptrace.cc @@ -59,6 +59,13 @@ typedef char fpregs_struct[ARM_VFPREGS_SIZE]; #define PRINT_REG_PC(__regs) printf ("%x\n", (unsigned) (__regs.ARM_pc)) #define PRINT_REG_FP(__fpregs) printf ("%x\n", (unsigned) (__fpregs + 32 * 8)) #define __PTRACE_FPREQUEST PTRACE_GETVFPREGS + +#elif defined(__s390__) +typedef _user_regs_struct regs_struct; +typedef _user_fpregs_struct fpregs_struct; +#define PRINT_REG_PC(__regs) printf ("%lx\n", (unsigned long) (__regs.psw.addr)) +#define PRINT_REG_FP(__fpregs) printf ("%lx\n", (unsigned long) (__fpregs.fpc)) +#define ARCH_IOVEC_FOR_GETREGSET #endif diff --git a/test/sanitizer_common/TestCases/Linux/ptrace.cc b/test/sanitizer_common/TestCases/Linux/ptrace.cc index 67b647430..b10aecd35 100644 --- a/test/sanitizer_common/TestCases/Linux/ptrace.cc +++ b/test/sanitizer_common/TestCases/Linux/ptrace.cc @@ -92,6 +92,26 @@ int main(void) { printf("%x\n", fpregs.fpsr); #endif // (__aarch64__) +#if (__s390__) + struct iovec regset_io; + + struct _user_regs_struct regs; + regset_io.iov_base = ®s; + regset_io.iov_len = sizeof(regs); + res = ptrace(PTRACE_GETREGSET, pid, (void*)NT_PRSTATUS, (void*)®set_io); + assert(!res); + if (regs.psw.addr) + printf("%lx\n", regs.psw.addr); + + struct _user_fpregs_struct fpregs; + regset_io.iov_base = &fpregs; + regset_io.iov_len = sizeof(fpregs); + res = ptrace(PTRACE_GETREGSET, pid, (void*)NT_FPREGSET, (void*)®set_io); + assert(!res); + if (fpregs.fpc) + printf("%x\n", fpregs.fpc); +#endif // (__s390__) + siginfo_t siginfo; res = ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo); assert(!res); |