Reviewers: ulan, benm,

Message:
Hi, when I run d8 compiled for Android on x86 with "--prof", it will crash. I
made a fix here. Would you please help review? Many thanks.

Description:
Fix ucontext structure for Android on x86

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

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/platform-linux.cc


Index: src/platform-linux.cc
===================================================================
--- src/platform-linux.cc       (revision 11534)
+++ src/platform-linux.cc       (working copy)
@@ -966,43 +966,22 @@

 #elif !defined(__GLIBC__) && defined(__i386__)
 // x86 version for Android.
-struct _libc_fpreg {
-  uint16_t significand[4];
-  uint16_t exponent;
+struct sigcontext {
+  uint32_t gregs[16];
+  void* fpregs;
+  uint32_t oldmask;
+  uint32_t cr2;
 };

-struct _libc_fpstate {
-  uint64_t cw;
-  uint64_t sw;
-  uint64_t tag;
-  uint64_t ipoff;
-  uint64_t cssel;
-  uint64_t dataoff;
-  uint64_t datasel;
-  struct _libc_fpreg _st[8];
-  uint64_t status;
-};
-
-typedef struct _libc_fpstate *fpregset_t;
-
-typedef struct mcontext {
-  int32_t gregs[19];
-  fpregset_t fpregs;
-  int64_t oldmask;
-  int64_t cr2;
-} mcontext_t;
-
-typedef uint64_t __sigset_t;
-
-typedef struct ucontext {
-  uint64_t uc_flags;
-  struct ucontext *uc_link;
-  stack_t uc_stack;
-  mcontext_t uc_mcontext;
-  __sigset_t uc_sigmask;
-  struct _libc_fpstate __fpregs_mem;
-} ucontext_t;
-
+typedef uint32_t __sigset_t;
+typedef struct sigcontext mcontext_t;
+typedef struct ucontext {
+  uint32_t uc_flags;
+  struct ucontext* uc_link;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  __sigset_t uc_sigmask;
+} ucontext_t;
 enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 };
 #endif



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

Reply via email to