Remove amd64_linux_gregset64_reg_offset.
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Apr 2010 20:02:55 +0000 (20:02 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Apr 2010 20:02:55 +0000 (20:02 +0000)
2010-04-22  H.J. Lu  <hongjiu.lu@intel.com>

* amd64-linux-nat.c (amd64_linux_gregset64_reg_offset): Removed.
(_initialize_amd64_linux_nat): Replace
amd64_linux_gregset64_reg_offset with
amd64_linux_gregset_reg_offset.

* amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Make it
global.

* amd64-tdep.h (amd64_linux_gregset_reg_offset): New.

gdb/ChangeLog
gdb/amd64-linux-nat.c
gdb/amd64-linux-tdep.c
gdb/amd64-tdep.h

index fe5eb7b..7d007b9 100644 (file)
@@ -1,3 +1,15 @@
+2010-04-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * amd64-linux-nat.c (amd64_linux_gregset64_reg_offset): Removed.
+       (_initialize_amd64_linux_nat): Replace
+       amd64_linux_gregset64_reg_offset with
+       amd64_linux_gregset_reg_offset.
+
+       * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Make it
+       global.
+
+       * amd64-tdep.h (amd64_linux_gregset_reg_offset): New.
+
 2010-04-22  Pierre Muller  <muller@ics.u-strasbg.fr>
 
        PR stabs/11479.
index 9812610..c0edc10 100644 (file)
 static int have_ptrace_getregset = -1;
 
 /* Mapping between the general-purpose registers in GNU/Linux x86-64
-   `struct user' format and GDB's register cache layout.  */
-
-static int amd64_linux_gregset64_reg_offset[] =
-{
-  RAX * 8, RBX * 8,            /* %rax, %rbx */
-  RCX * 8, RDX * 8,            /* %rcx, %rdx */
-  RSI * 8, RDI * 8,            /* %rsi, %rdi */
-  RBP * 8, RSP * 8,            /* %rbp, %rsp */
-  R8 * 8, R9 * 8,              /* %r8 ... */
-  R10 * 8, R11 * 8,
-  R12 * 8, R13 * 8,
-  R14 * 8, R15 * 8,            /* ... %r15 */
-  RIP * 8, EFLAGS * 8,         /* %rip, %eflags */
-  CS * 8, SS * 8,              /* %cs, %ss */
-  DS * 8, ES * 8,              /* %ds, %es */
-  FS * 8, GS * 8,              /* %fs, %gs */
-  -1, -1, -1, -1, -1, -1, -1, -1,
-  -1, -1, -1, -1, -1, -1, -1, -1,
-  -1, -1, -1, -1, -1, -1, -1, -1,
-  -1, -1, -1, -1, -1, -1, -1, -1, -1,
-  -1, -1, -1, -1, -1, -1, -1, -1,
-  -1, -1, -1, -1, -1, -1, -1, -1,
-  ORIG_RAX * 8
-};
-\f
-
-/* Mapping between the general-purpose registers in GNU/Linux x86-64
    `struct user' format and GDB's register cache layout for GNU/Linux
    i386.
 
@@ -807,13 +780,11 @@ _initialize_amd64_linux_nat (void)
 
   amd64_native_gregset32_reg_offset = amd64_linux_gregset32_reg_offset;
   amd64_native_gregset32_num_regs = I386_LINUX_NUM_REGS;
-  amd64_native_gregset64_reg_offset = amd64_linux_gregset64_reg_offset;
+  amd64_native_gregset64_reg_offset = amd64_linux_gregset_reg_offset;
   amd64_native_gregset64_num_regs = AMD64_LINUX_NUM_REGS;
 
   gdb_assert (ARRAY_SIZE (amd64_linux_gregset32_reg_offset)
              == amd64_native_gregset32_num_regs);
-  gdb_assert (ARRAY_SIZE (amd64_linux_gregset64_reg_offset)
-             == amd64_native_gregset64_num_regs);
 
   /* Fill in the generic GNU/Linux methods.  */
   t = linux_target ();
index 7376ba7..1eac4c6 100644 (file)
@@ -62,7 +62,7 @@ static struct core_regset_section amd64_linux_regset_sections[] =
    format and GDB's register cache layout.  */
 
 /* From <sys/reg.h>.  */
-static int amd64_linux_gregset_reg_offset[] =
+int amd64_linux_gregset_reg_offset[] =
 {
   10 * 8,                      /* %rax */
   5 * 8,                       /* %rbx */
index 9f07dda..e67106d 100644 (file)
@@ -109,6 +109,9 @@ void amd64_classify (struct type *type, enum amd64_reg_class class[2]);
 
 \f
 
+/* Variables exported from amd64-linux-tdep.c.  */
+extern int amd64_linux_gregset_reg_offset[];
+
 /* Variables exported from amd64nbsd-tdep.c.  */
 extern int amd64nbsd_r_reg_offset[];