diff options
author | Michal Ludvig <mludvig@suse.cz> | 2003-07-15 11:33:59 +0000 |
---|---|---|
committer | Michal Ludvig <mludvig@suse.cz> | 2003-07-15 11:33:59 +0000 |
commit | eba29c8cbb877e5cd9e84be0240c171790aecf7e (patch) | |
tree | c92c4afd92a92265db5554c3c81ccf2c582fd272 /gdb/x86-64-linux-nat.c | |
parent | 963ac3630d56f158f8719609b552cd9923c39840 (diff) | |
download | gdb-eba29c8cbb877e5cd9e84be0240c171790aecf7e.zip gdb-eba29c8cbb877e5cd9e84be0240c171790aecf7e.tar.gz gdb-eba29c8cbb877e5cd9e84be0240c171790aecf7e.tar.bz2 |
2003-07-15 Michal Ludvig <mludvig@suse.cz>
* x86-64-linux-nat.c (regmap): Removed.
(supply_gregset, fill_gregset): Call
x86_64_linux_(fill,supply)_gregset functions.
* x86-64-linux-tdep.c (USER_*): New defines.
(user_to_gdb_regmap, x86_64_core_fns): New structure.
(x86_64_linux_supply_gregset, x86_64_linux_fill_gregset):
New functions.
(fetch_core_registers): Ditto.
(_initialize_x86_64_linux_tdep): Call add_core_fns().
* x86-64-linux-tdep.h: New file.
* config/i386/x86-64linux.mh (NATDEPFILES): Remove corelow.o
and core-regset.o.
* config/i386/x86-64linux.mt (TDEPFILES): Add corelow.o.
Diffstat (limited to 'gdb/x86-64-linux-nat.c')
-rw-r--r-- | gdb/x86-64-linux-nat.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c index 4a989ce..c44c35e 100644 --- a/gdb/x86-64-linux-nat.c +++ b/gdb/x86-64-linux-nat.c @@ -38,24 +38,7 @@ #include "gregset.h" #include "x86-64-tdep.h" - -/* The register sets used in GNU/Linux ELF core-dumps are identical to - the register sets used by `ptrace'. The corresponding types are - `elf_gregset_t' for the general-purpose registers (with - `elf_greg_t' the type of a single GP register) and `elf_fpregset_t' - for the floating-point registers. */ - -/* Mapping between the general-purpose registers in `struct user' - format and GDB's register array layout. */ -static int regmap[] = -{ - RAX, RBX, RCX, RDX, - RSI, RDI, RBP, RSP, - R8, R9, R10, R11, - R12, R13, R14, R15, - RIP, EFLAGS, CS, SS, - DS, ES, FS, GS -}; +#include "x86-64-linux-tdep.h" /* Which ptrace request retrieves which registers? These apply to the corresponding SET requests as well. */ @@ -76,11 +59,7 @@ static int regmap[] = void supply_gregset (elf_gregset_t *gregsetp) { - elf_greg_t *regp = (elf_greg_t *) gregsetp; - int i; - - for (i = 0; i < X86_64_NUM_GREGS; i++) - supply_register (i, regp + regmap[i]); + x86_64_linux_supply_gregset ((char *) gregsetp); } /* Fill register REGNO (if it is a general-purpose register) in @@ -90,12 +69,7 @@ supply_gregset (elf_gregset_t *gregsetp) void fill_gregset (elf_gregset_t *gregsetp, int regno) { - elf_greg_t *regp = (elf_greg_t *) gregsetp; - int i; - - for (i = 0; i < X86_64_NUM_GREGS; i++) - if (regno == -1 || regno == i) - regcache_collect (i, regp + regmap[i]); + x86_64_linux_fill_gregset ((char *) gregsetp, regno); } /* Fetch all general-purpose registers from process/thread TID and |