* amd64fbsd-tdep.c (amd64fbsd_r_reg_offset): New variable.
authorMark Kettenis <kettenis@gnu.org>
Sat, 11 Oct 2003 14:54:24 +0000 (14:54 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sat, 11 Oct 2003 14:54:24 +0000 (14:54 +0000)
(amd64fbsd_init_abi): Set TDEP->gregset_reg_offset,
TDEP->gregset_num_regs and TDEP->sizeof_gregset.  Use ARRAY_SIZE
in initialization of TDEP->sc_num_regs.

gdb/ChangeLog
gdb/amd64fbsd-tdep.c

index 20e05f37741949e0fa1b6af22bed5a3f0b2ee18e..0a4665aa90947314c7f2e03cc9385c385a4ed3f7 100644 (file)
@@ -1,5 +1,10 @@
 2003-10-11  Mark Kettenis  <kettenis@gnu.org>
 
+       * amd64fbsd-tdep.c (amd64fbsd_r_reg_offset): New variable.
+       (amd64fbsd_init_abi): Set TDEP->gregset_reg_offset,
+       TDEP->gregset_num_regs and TDEP->sizeof_gregset.  Use ARRAY_SIZE
+       in initialization of TDEP->sc_num_regs.
+
        * x86-64-tdep.c (x86_64_regset_from_core_section): New function.
        (x86_64_init_abi): Initialize regset_from_core_section if
        appropriate.
index 9f6c21723282dca4db0cf0af8e076b3355bde108..b2c3108b978fe11651cf9e79950b4b800fd98ee7 100644 (file)
@@ -1,4 +1,5 @@
 /* Target-dependent code for FreeBSD/amd64.
+
    Copyright 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -48,6 +49,26 @@ amd64fbsd_sigcontext_addr (struct frame_info *next_frame)
 \f
 /* FreeBSD 5.1-RELEASE or later.  */
 
+/* Mapping between the general-purpose registers in `struct reg'
+   format and GDB's register cache layout.
+
+   Note that some registers are 32-bit, but since we're little-endian
+   we get away with that.  */
+
+/* From <machine/reg.h>.  */
+static int amd64fbsd_r_reg_offset[] =
+{
+  14 * 8, 11 * 8,              /* %rax, %rbx */
+  13 * 8, 12 * 8,              /* %rcx, %rdx */
+  9 * 8, 8 * 8,                        /* %rsi, %rdi */
+  10 * 8, 20 * 8,              /* %rbp, %rsp */
+  7 * 8, 6 * 8, 5 * 8, 4 * 8,  /* %r8 ... */
+  3 * 8, 2 * 8, 1 * 8, 0 * 8,  /* ... %r15 */
+  17 * 8, 19 * 8,              /* %rip, %eflags */
+  -1, -1,                      /* %ds, %es */
+  -1, -1                       /* %fs, %gs */
+};
+
 /* Location of the signal trampoline.  */
 CORE_ADDR amd64fbsd_sigtramp_start = 0x7fffffffffc0;
 CORE_ADDR amd64fbsd_sigtramp_end = 0x7fffffffffe0;
@@ -87,13 +108,17 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* Obviously FreeBSD is BSD-based.  */
   i386bsd_init_abi (info, gdbarch);
 
+  tdep->gregset_reg_offset = amd64fbsd_r_reg_offset;
+  tdep->gregset_num_regs = ARRAY_SIZE (amd64fbsd_r_reg_offset);
+  tdep->sizeof_gregset = 22 * 8;
+
   x86_64_init_abi (info, gdbarch);
 
   tdep->sigtramp_start = amd64fbsd_sigtramp_start;
   tdep->sigtramp_end = amd64fbsd_sigtramp_end;
   tdep->sigcontext_addr = amd64fbsd_sigcontext_addr;
   tdep->sc_reg_offset = amd64fbsd_sc_reg_offset;
-  tdep->sc_num_regs = X86_64_NUM_GREGS;
+  tdep->sc_num_regs = ARRAY_SIZE (amd64fbsd_sc_reg_offset);
 }
 \f
 
This page took 0.043841 seconds and 4 git commands to generate.