[compiler-rt] r208363 - Fixup for r208066. Properly get values of PTRACE_GETREGSET/PTRACE_SETREGSET.
Alexey Samsonov
samsonov at google.com
Thu May 8 15:11:20 PDT 2014
Author: samsonov
Date: Thu May 8 17:11:20 2014
New Revision: 208363
URL: http://llvm.org/viewvc/llvm-project?rev=208363&view=rev
Log:
Fixup for r208066. Properly get values of PTRACE_GETREGSET/PTRACE_SETREGSET.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
compiler-rt/trunk/test/msan/ptrace.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc?rev=208363&r1=208362&r2=208363&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc Thu May 8 17:11:20 2014
@@ -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
Modified: compiler-rt/trunk/test/msan/ptrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/ptrace.cc?rev=208363&r1=208362&r2=208363&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/ptrace.cc (original)
+++ compiler-rt/trunk/test/msan/ptrace.cc Thu May 8 17:11:20 2014
@@ -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;
More information about the llvm-commits
mailing list