diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-10-11 14:19:11 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-10-11 14:19:11 +0000 |
commit | c6b33596909ddd557a49fe34816b2a887e228d10 (patch) | |
tree | 65c86a27691227f7517fc0e7fba7508e97901208 /gdb/x86-64-tdep.c | |
parent | 8446b36a38e57d7fb96c4c2a962b8765d70f248b (diff) | |
download | gdb-c6b33596909ddd557a49fe34816b2a887e228d10.zip gdb-c6b33596909ddd557a49fe34816b2a887e228d10.tar.gz gdb-c6b33596909ddd557a49fe34816b2a887e228d10.tar.bz2 |
* x86-64-tdep.c (x86_64_regset_from_core_section): New function.
(x86_64_init_abi): Initialize regset_from_core_section if
appropriate.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r-- | gdb/x86-64-tdep.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 8290023..351b115 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1220,6 +1220,31 @@ x86_64_supply_fpregset (const struct regset *regset, struct regcache *regcache, x86_64_supply_fxsave (regcache, regnum, fpregs); } +/* Return the appropriate register set for the core section identified + by SECT_NAME and SECT_SIZE. */ + +static const struct regset * +x86_64_regset_from_core_section (struct gdbarch *gdbarch, + const char *sect_name, size_t sect_size) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset) + { + if (tdep->fpregset == NULL) + { + tdep->fpregset = XMALLOC (struct regset); + tdep->fpregset->descr = tdep; + tdep->fpregset->supply_regset = x86_64_supply_fpregset; + } + + return tdep->fpregset; + } + + return i386_regset_from_core_section (gdbarch, sect_name, sect_size); +} + + void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1297,6 +1322,11 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) frame_unwind_append_sniffer (gdbarch, x86_64_sigtramp_frame_sniffer); frame_unwind_append_sniffer (gdbarch, x86_64_frame_sniffer); frame_base_set_default (gdbarch, &x86_64_frame_base); + + /* If we have a register mapping, enable the generic core file support. */ + if (tdep->gregset_reg_offset) + set_gdbarch_regset_from_core_section (gdbarch, + x86_64_regset_from_core_section); } |