Fixup for r208066. Properly get values of PTRACE_GETREGSET/PTRACE_SETREGSET.

llvm-svn: 208363
This commit is contained in:
Alexey Samsonov 2014-05-08 22:11:20 +00:00
parent e08c540e68
commit 35744c4753
2 changed files with 9 additions and 1 deletions

View File

@ -289,7 +289,8 @@ namespace __sanitizer {
int ptrace_setfpregs = PTRACE_SETFPREGS;
int ptrace_getfpxregs = PTRACE_GETFPXREGS;
int ptrace_setfpxregs = PTRACE_SETFPXREGS;
#if defined(PTRACE_GETSIGINFO) && defined(PTRACE_SETSIGINFO)
#if (defined(PTRACE_GETSIGINFO) && defined(PTRACE_SETSIGINFO)) || \
(defined(PT_GETSIGINFO) && defined(PT_SETSIGINFO))
int ptrace_getsiginfo = PTRACE_GETSIGINFO;
int ptrace_setsiginfo = PTRACE_SETSIGINFO;
#else

View File

@ -1,6 +1,7 @@
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
#include <assert.h>
#include <signal.h>
#include <stdio.h>
#include <sys/ptrace.h>
#include <sys/types.h>
@ -29,7 +30,13 @@ int main(void) {
if (fpregs.mxcsr)
printf("%x\n", fpregs.mxcsr);
siginfo_t siginfo;
res = ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo);
assert(!res);
assert(siginfo.si_pid == pid);
ptrace(PTRACE_CONT, pid, NULL, NULL);
wait(NULL);
}
return 0;