[compiler-rt] r178630 - [Sanitizer] Be more careful with arch-specific defines in StopTheWorld code
Alexey Samsonov
samsonov at google.com
Wed Apr 3 01:26:03 PDT 2013
Author: samsonov
Date: Wed Apr 3 03:26:03 2013
New Revision: 178630
URL: http://llvm.org/viewvc/llvm-project?rev=178630&view=rev
Log:
[Sanitizer] Be more careful with arch-specific defines in StopTheWorld code
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=178630&r1=178629&r2=178630&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Apr 3 03:26:03 2013
@@ -59,6 +59,7 @@
# define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_GETPWNAM_GETPWUID SI_NOT_WINDOWS
-# define SANITIZER_INTERCEPT_GETPWNAM_R_GETPWUID_R SI_MAC || SI_LINUX_NOT_ANDROID
+# define SANITIZER_INTERCEPT_GETPWNAM_R_GETPWUID_R \
+ SI_MAC || SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_CLOCK_GETTIME SI_LINUX
# define SANITIZER_INTERCEPT_GETITIMER SI_NOT_WINDOWS
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc?rev=178630&r1=178629&r2=178630&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc Wed Apr 3 03:26:03 2013
@@ -350,7 +350,7 @@ void StopTheWorld(StopTheWorldCallback c
}
// Platform-specific methods from SuspendedThreadsList.
-#if defined(SANITIZER_ANDROID) && defined(__arm__)
+#if defined(__arm__)
typedef pt_regs regs_struct;
#else
typedef user_regs_struct regs_struct;
@@ -368,10 +368,12 @@ int SuspendedThreadsList::GetRegistersAn
}
#if defined(__arm__)
*sp = regs.ARM_sp;
-#elif SANITIZER_WORDSIZE == 32
+#elif defined(__i386__)
*sp = regs.esp;
-#else
+#elif defined(__x86_64__)
*sp = regs.rsp;
+#else
+ UNIMPLEMENTED("Unknown architecture");
#endif
internal_memcpy(buffer, ®s, sizeof(regs));
return 0;
More information about the llvm-commits
mailing list