aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-64-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-10-05 21:31:33 +0000
committerMark Kettenis <kettenis@gnu.org>2003-10-05 21:31:33 +0000
commit473f17b0436507838ab28e57e7ca581d71c059b8 (patch)
treee0e9aad96933fd3e0614ebba92fa46ad69881fdc /gdb/x86-64-tdep.c
parentc2059446380ed39ede4bb55ad2dbdb8cfb9df5dd (diff)
downloadgdb-473f17b0436507838ab28e57e7ca581d71c059b8.zip
gdb-473f17b0436507838ab28e57e7ca581d71c059b8.tar.gz
gdb-473f17b0436507838ab28e57e7ca581d71c059b8.tar.bz2
* i386-tdep.h (struct gdbarch_tdep): Add members gregset,
gregset_reg_offset, gregset_num_regs, sizeof_gregset, fpregset, sizeof_fpregset. * i386-tdep.c: Include "regset.h". (i386_supply_gregset): New function. (i386_supply_fpregset): New function. (i386_gdbarch_init): Initialze register set-related members of TDEP. * x86-64-tdep.c (x86_64_supply_fpregset): New function. (x86_64_init_abi): Initialize TDEP->sizeof_fpregset.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r--gdb/x86-64-tdep.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index ddba4db..d17ee8c 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -1203,12 +1203,31 @@ x86_64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
return sp & -(CORE_ADDR)16;
}
+
+
+/* Supply register REGNUM from the floating-point register set REGSET
+ to register cache REGCACHE. If REGNUM is -1, do this for all
+ registers in REGSET. */
+
+static void
+x86_64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
+ int regnum, const void *fpregs, size_t len)
+{
+ const struct gdbarch_tdep *tdep = regset->descr;
+
+ gdb_assert (len == tdep->sizeof_fpregset);
+ x86_64_supply_fxsave (regcache, regnum, fpregs);
+}
void
x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ /* AMD64 generally uses `fxsave' instead of `fsave' for saving its
+ floating-point registers. */
+ tdep->sizeof_fpregset = I387_SIZEOF_FXSAVE;
+
/* AMD64 has an FPU and 16 SSE registers. */
tdep->st0_regnum = X86_64_ST0_REGNUM;
tdep->num_xmm_regs = 16;