Revert "linux-user: Added ELF coredump support for x86 and x86_64 targets"
authorRiku Voipio <riku.voipio@nokia.com>
Mon, 20 Apr 2009 14:09:22 +0000 (17:09 +0300)
committerRiku Voipio <riku.voipio@nokia.com>
Mon, 20 Apr 2009 14:09:22 +0000 (17:09 +0300)
This reverts commit a1947ff31251f29b188bf2eb936c5c7a50aadca6.

linux-user/elfload.c
linux-user/i386/syscall.h
linux-user/x86_64/syscall.h

index 706c8e2..3c8c9a0 100644 (file)
@@ -133,45 +133,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
     regs->rip = infop->entry;
 }
 
-#define USE_ELF_CORE_DUMP
-
-typedef struct target_pt_regs elf_gregset_t;
-
-/*
- * For register format that gdb uses, see <sys/reg.h>.  These
- * should be in same format (which is usually same as target_pt_regs).
- */
-static void elf_core_copy_regs(elf_gregset_t *elfregs, const CPUState *env)
-{
-    (void) memset(elfregs, 0, sizeof (*elfregs));
-
-    /* GPRs */
-    elfregs->r15 = env->regs[15];
-    elfregs->r14 = env->regs[14];
-    elfregs->r13 = env->regs[13];
-    elfregs->r12 = env->regs[12];
-    elfregs->rbp = env->regs[R_EBP];
-    elfregs->rbx = env->regs[R_EBX];
-    elfregs->r11 = env->regs[11];
-    elfregs->r10 = env->regs[10];
-    elfregs->r9 = env->regs[9];
-    elfregs->r8 = env->regs[8];
-    elfregs->rax = env->regs[R_EAX];
-    elfregs->rcx = env->regs[R_ECX];
-    elfregs->rdx = env->regs[R_EDX];
-    elfregs->rsi = env->regs[R_ESI];
-    elfregs->rdi = env->regs[R_EDI];
-    elfregs->orig_rax = env->regs[R_EAX];
-    elfregs->rip = env->eip;
-    elfregs->rsp = env->regs[R_ESP];
-    elfregs->eflags = env->eflags;
-
-    /* segment registers */
-    elfregs->cs = env->segs[R_CS].selector;
-    elfregs->ss = env->segs[R_SS].selector;
-}
-
-#else /* !TARGET_X86_64 */
+#else
 
 #define ELF_START_MMAP 0x80000000
 
@@ -201,38 +163,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
        A value of 0 tells we have no such handler.  */
     regs->edx = 0;
 }
-
-#define USE_ELF_CORE_DUMP
-
-typedef struct target_pt_regs elf_gregset_t;
-
-static void elf_core_copy_regs(elf_gregset_t *elfregs, const CPUState *env)
-{
-    (void) memset(elfregs, 0, sizeof (*elfregs));
-
-    /* GPRs */
-    elfregs->ebx = env->regs[R_EBX];
-    elfregs->ecx = env->regs[R_ECX];
-    elfregs->edx = env->regs[R_EDX];
-    elfregs->esi = env->regs[R_ESI];
-    elfregs->edi = env->regs[R_EDI];
-    elfregs->ebp = env->regs[R_EBP];
-    elfregs->eax = env->regs[R_EAX];
-    elfregs->orig_eax = env->regs[R_EAX]; /* XXX */
-    elfregs->esp = env->regs[R_ESP];
-    elfregs->eip = env->eip;
-    elfregs->eflags = env->eflags;
-
-    /* segment registers */
-    elfregs->xds = env->segs[R_DS].selector;
-    elfregs->xes = env->segs[R_ES].selector;
-    elfregs->xcs = env->segs[R_CS].selector;
-    elfregs->xss = env->segs[R_SS].selector;
-    elfregs->xfs = env->segs[R_FS].selector;
-    elfregs->xgs = env->segs[R_GS].selector;
-}
-
-#endif /* TARGET_i386 */
+#endif
 
 #define ELF_EXEC_PAGESIZE      4096
 
@@ -275,10 +206,10 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
 
 typedef struct target_pt_regs elf_gregset_t;
 
+static void elf_core_copy_regs(elf_gregset_t *, const CPUState *);
+
 static void elf_core_copy_regs(elf_gregset_t *elfregs, const CPUState *env)
 {
-    (void) memset(elfregs, 0, sizeof (*elfregs));
-
     elfregs->ARM_r0 = env->regs[0];
     elfregs->ARM_r1 = env->regs[1];
     elfregs->ARM_r2 = env->regs[2];
@@ -1681,9 +1612,9 @@ struct memelfnote {
 };
 
 struct elf_siginfo {
-    int  si_signo; /* signal number */
-    int  si_code;  /* extra code */
-    int  si_errno; /* errno */
+    abi_long  si_signo; /* signal number */
+    abi_long  si_code;  /* extra code */
+    abi_long  si_errno; /* errno */
 };
 
 struct elf_prstatus {
@@ -1691,10 +1622,10 @@ struct elf_prstatus {
     short              pr_cursig;    /* Current signal */
     target_ulong       pr_sigpend;   /* XXX */
     target_ulong       pr_sighold;   /* XXX */
-    int                pr_pid;
-    int                pr_ppid;
-    int                pr_pgrp;
-    int                pr_sid;
+    abi_long           pr_pid;
+    abi_long           pr_ppid;
+    abi_long           pr_pgrp;
+    abi_long           pr_sid;
     struct target_timeval pr_utime;  /* XXX User time */
     struct target_timeval pr_stime;  /* XXX System time */
     struct target_timeval pr_cutime; /* XXX Cumulative user time */
index 90405ea..266e2c4 100644 (file)
@@ -3,23 +3,21 @@
 #define __USER_DS      (0x2B)
 
 struct target_pt_regs {
-    abi_ulong ebx;
-    abi_ulong ecx;
-    abi_ulong edx;
-    abi_ulong esi;
-    abi_ulong edi;
-    abi_ulong ebp;
-    abi_ulong eax;
-    abi_ulong xds;
-    abi_ulong xes;
-    abi_ulong xfs;
-    abi_ulong xgs;
-    abi_ulong orig_eax;
-    abi_ulong eip;
-    abi_ulong xcs;
-    abi_ulong eflags;
-    abi_ulong esp;
-    abi_ulong xss;
+       long ebx;
+       long ecx;
+       long edx;
+       long esi;
+       long edi;
+       long ebp;
+       long eax;
+       int  xds;
+       int  xes;
+       long orig_eax;
+       long eip;
+       int  xcs;
+       long eflags;
+       long esp;
+       int  xss;
 };
 
 /* ioctls */
index ab82ce0..2a8d696 100644 (file)
@@ -2,36 +2,30 @@
 #define __USER_DS      (0x2B)
 
 struct target_pt_regs {
-    abi_ulong r15;
-    abi_ulong r14;
-    abi_ulong r13;
-    abi_ulong r12;
-    abi_ulong rbp;
-    abi_ulong rbx;
+       abi_ulong r15;
+       abi_ulong r14;
+       abi_ulong r13;
+       abi_ulong r12;
+       abi_ulong rbp;
+       abi_ulong rbx;
 /* arguments: non interrupts/non tracing syscalls only save upto here*/
-    abi_ulong r11;
-    abi_ulong r10;
-    abi_ulong r9;
-    abi_ulong r8;
-    abi_ulong rax;
-    abi_ulong rcx;
-    abi_ulong rdx;
-    abi_ulong rsi;
-    abi_ulong rdi;
-    abi_ulong orig_rax;
+       abi_ulong r11;
+       abi_ulong r10;
+       abi_ulong r9;
+       abi_ulong r8;
+       abi_ulong rax;
+       abi_ulong rcx;
+       abi_ulong rdx;
+       abi_ulong rsi;
+       abi_ulong rdi;
+       abi_ulong orig_rax;
 /* end of arguments */
 /* cpu exception frame or undefined */
-    abi_ulong rip;
-    abi_ulong cs;
-    abi_ulong eflags;
-    abi_ulong rsp;
-    abi_ulong ss;
-    abi_ulong fs_base;
-    abi_ulong gs_base;
-    abi_ulong ds;
-    abi_ulong es;
-    abi_ulong fs;
-    abi_ulong gs;
+       abi_ulong rip;
+       abi_ulong cs;
+       abi_ulong eflags;
+       abi_ulong rsp;
+       abi_ulong ss;
 /* top of stack page */
 };