diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-12-01 13:42:41 +0100 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-12-01 13:42:41 +0100 |
commit | ac3d87c0d256547c036067de7bceee320b9bab8f (patch) | |
tree | ab3378d16a5dab2228a874fb2d713fa18202513e /gdb/i386gnu-tdep.c | |
parent | 591f7597d447d8d038d6d8e24a706d1d5e32eba1 (diff) | |
download | gdb-ac3d87c0d256547c036067de7bceee320b9bab8f.zip gdb-ac3d87c0d256547c036067de7bceee320b9bab8f.tar.gz gdb-ac3d87c0d256547c036067de7bceee320b9bab8f.tar.bz2 |
Use core regset iterators on GNU Hurd
Remove native-only core file handling on GNU Hurd. Instead, enable the
x86 target generic core regset logic on the Hurd by providing an
appropriate register offset map.
Thanks to Samuel Thibault for testing!
gdb/
* config/i386/i386gnu.mh (NATDEPFILES): Remove core-regset.o.
* i386gnu-nat.c: Do not include <sys/procfs.h> or "gregset.h".
(CREG_OFFSET, creg_offset, CREG_ADDR): Remove.
(supply_gregset, supply_fpregset): Remove.
* i386gnu-tdep.c (i386gnu_gregset_reg_offset): New variable.
(i386gnu_init_abi): Set tdep->gregset_reg_offset, gregset_num_regs,
and sizeof_gregset.
Diffstat (limited to 'gdb/i386gnu-tdep.c')
-rw-r--r-- | gdb/i386gnu-tdep.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/i386gnu-tdep.c b/gdb/i386gnu-tdep.c index 1c68841..be863bf 100644 --- a/gdb/i386gnu-tdep.c +++ b/gdb/i386gnu-tdep.c @@ -22,6 +22,27 @@ #include "i386-tdep.h" +/* From <sys/ucontext.h>. */ +static int i386gnu_gregset_reg_offset[] = +{ + 11 * 4, /* %eax */ + 10 * 4, /* %ecx */ + 9 * 4, /* %edx */ + 8 * 4, /* %ebx */ + 17 * 4, /* %uesp */ + 6 * 4, /* %ebp */ + 5 * 4, /* %esi */ + 4 * 4, /* %edi */ + 14 * 4, /* %eip */ + 16 * 4, /* %efl */ + 15 * 4, /* %cs */ + 18 * 4, /* %ss */ + 3 * 4, /* %ds */ + 2 * 4, /* %es */ + 1 * 4, /* %fs */ + 0 * 4, /* %gs */ +}; + static void i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -33,6 +54,10 @@ i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); + tdep->gregset_reg_offset = i386gnu_gregset_reg_offset; + tdep->gregset_num_regs = ARRAY_SIZE (i386gnu_gregset_reg_offset); + tdep->sizeof_gregset = 19 * 4; + tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */ } |