forked from Imagelibrary/binutils-gdb
* 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.
This commit is contained in:
@@ -28,12 +28,15 @@
|
||||
#include <sys/procfs.h>
|
||||
#include <sys/ptrace.h>
|
||||
|
||||
static int regmap[] = {
|
||||
RAX, RDX, RCX, RBX,
|
||||
#define X86_64_NUM_GREGS 22
|
||||
|
||||
static int regmap[X86_64_NUM_GREGS] = {
|
||||
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 void
|
||||
@@ -41,7 +44,7 @@ x86_64_fill_gregset (void *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 18; i++)
|
||||
for (i = 0; i < X86_64_NUM_GREGS; i++)
|
||||
collect_register (i, ((char *) buf) + regmap[i]);
|
||||
}
|
||||
|
||||
@@ -50,7 +53,7 @@ x86_64_store_gregset (void *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 18; i++)
|
||||
for (i = 0; i < X86_64_NUM_GREGS; i++)
|
||||
supply_register (i, ((char *) buf) + regmap[i]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user