Adjust for differences in the arm signal structures between glibc versions.
authordeanm@chromium.org <deanm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 13 May 2009 13:44:25 +0000 (13:44 +0000)
committerdeanm@chromium.org <deanm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 13 May 2009 13:44:25 +0000 (13:44 +0000)
Review URL: http://codereview.chromium.org/113332

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1935 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/platform-linux.cc

index 69e767accd0e567574fa1810936c839d79a4572f..6e1faf831757cac9ed71c6f85aba925e5e72a9fe 100644 (file)
@@ -611,9 +611,16 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
     sample.sp = mcontext.gregs[REG_RSP];
     sample.fp = mcontext.gregs[REG_RBP];
 #elif V8_HOST_ARCH_ARM
+// An undefined macro evaluates to 0, so this applies to Android's Bionic also.
+#if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
     sample.pc = mcontext.gregs[R15];
     sample.sp = mcontext.gregs[R13];
     sample.fp = mcontext.gregs[R11];
+#else
+    sample.pc = mcontext.arm_pc;
+    sample.sp = mcontext.arm_sp;
+    sample.fp = mcontext.arm_fp;
+#endif
 #endif
   }