summaryrefslogtreecommitdiff
path: root/gdb/x86-64-linux-nat.c
diff options
context:
space:
mode:
authorMichal Ludvig <mludvig@suse.cz>2002-03-27 10:21:29 +0000
committerMichal Ludvig <mludvig@suse.cz>2002-03-27 10:21:29 +0000
commit2a1c511a00eee0053606236417075f3e2ed409f0 (patch)
treeb9905789cf0ff33282d6f2f607e15744022d1ad9 /gdb/x86-64-linux-nat.c
parentda0dd106c65a61ce54c2f7020b11c1914f4235fb (diff)
downloadgdb-2a1c511a00eee0053606236417075f3e2ed409f0.tar.gz
* x86-64-tdep.h (X86_64_NUM_REGS, X86_64_NUM_GREGS): Delete #defines.
(x86_64_num_regs, x86_64_num_gregs): Added extern variables. * x86-64-linux-nat.c (x86_64_regmap): Swapped RBX <> RDX, added DS, ES, FS, GS. (x86_64_linux_dr_get_status, supply_gregset), (fill_gregset): Changed X86_64_NUM_GREGS to x86_64_num_gregs. * x86-64-tdep.c (x86_64_register_raw_size_table): Delete. (x86_64_register_info_table): Add. (X86_64_NUM_REGS, X86_64_NUM_GREGS): Add. (x86_64_register_raw_size, x86_64_register_virtual_type), (x86_64_register_name, _initialize_x86_64_tdep): Changed to reflect new general x86_64_register_info_table. (i386_gdbarch_init): gdbarch_register_bytes is now set dynamicaly during initialization. * regformats/reg-x86-64.dat: Synced with changes to registers above. * gdbserver/linux-x86-64-low.c: Ditto.
Diffstat (limited to 'gdb/x86-64-linux-nat.c')
-rw-r--r--gdb/x86-64-linux-nat.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index aafd2bed33e..4e15cb963a8 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -39,11 +39,12 @@
format and GDB's register array layout. */
static int x86_64_regmap[] = {
- RAX, RDX, RCX, RBX,
+ RAX, RBX, RCX, RDX,
RSI, RDI, RBP, RSP,
R8, R9, R10, R11,
R12, R13, R14, R15,
- RIP, EFLAGS
+ RIP, EFLAGS,
+ DS, ES, FS, GS
};
static unsigned long
@@ -125,7 +126,7 @@ x86_64_linux_dr_get_status (void)
the register sets used by `ptrace'. */
#define GETREGS_SUPPLIES(regno) \
- (0 <= (regno) && (regno) <= 17)
+ (0 <= (regno) && (regno) < x86_64_num_gregs)
#define GETFPREGS_SUPPLIES(regno) \
(FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
@@ -144,7 +145,7 @@ 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++)
+ for (i = 0; i < x86_64_num_gregs; i++)
supply_register (i, (char *) (regp + x86_64_regmap[i]));
}
@@ -158,7 +159,7 @@ 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++)
+ for (i = 0; i < x86_64_num_gregs; i++)
if ((regno == -1 || regno == i))
read_register_gen (i, regp + x86_64_regmap[i]);
}