Reviewers: Erik Corry,

Message:
Hey Erik,

Can you make sure this works ok on the Android build?

I think it should.

Thanks

Description:
Make the android arm sigcontext structure match glibc.

This code should be equivalent to the previous code, it is just that
instead
of accessing gregs[REG_NAME], glibc flattens the structure with
arm_regname.

Please review this at http://codereview.chromium.org/113332

Affected files:
   M src/platform-linux.cc


Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index  
69e767accd0e567574fa1810936c839d79a4572f..080af11eaf83e9d37a5418e3fe06f8f790fe8ca1
  
100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -569,13 +569,29 @@ static Sampler* active_sampler_ = NULL;
  // but the C library doesn't have the structs defined.

  struct sigcontext {
-  uint32_t trap_no;
-  uint32_t error_code;
-  uint32_t oldmask;
-  uint32_t gregs[16];
-  uint32_t arm_cpsr;
-  uint32_t fault_address;
+  unsigned long trap_no;
+  unsigned long error_code;
+  unsigned long oldmask;
+  unsigned long arm_r0;
+  unsigned long arm_r1;
+  unsigned long arm_r2;
+  unsigned long arm_r3;
+  unsigned long arm_r4;
+  unsigned long arm_r5;
+  unsigned long arm_r6;
+  unsigned long arm_r7;
+  unsigned long arm_r8;
+  unsigned long arm_r9;
+  unsigned long arm_r10;
+  unsigned long arm_fp;
+  unsigned long arm_ip;
+  unsigned long arm_sp;
+  unsigned long arm_lr;
+  unsigned long arm_pc;
+  unsigned long arm_cpsr;
+  unsigned long fault_address;
  };
+
  typedef uint32_t __sigset_t;
  typedef struct sigcontext mcontext_t;
  typedef struct ucontext {
@@ -585,7 +601,6 @@ typedef struct ucontext {
    mcontext_t uc_mcontext;
    __sigset_t uc_sigmask;
  } ucontext_t;
-enum ArmRegisters {R15 = 15, R13 = 13, R11 = 11};

  #endif

@@ -611,9 +626,9 @@ 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
-    sample.pc = mcontext.gregs[R15];
-    sample.sp = mcontext.gregs[R13];
-    sample.fp = mcontext.gregs[R11];
+    sample.pc = mcontext.arm_pc;
+    sample.sp = mcontext.arm_sp;
+    sample.fp = mcontext.arm_fp;
  #endif
    }




--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to