aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-64-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-05-31 16:11:47 +0000
committerMark Kettenis <kettenis@gnu.org>2003-05-31 16:11:47 +0000
commit2b5e07495d88a5301fa2d3ba7780246e79582c51 (patch)
treead0763f045ce8e2d37f83f8cacee78ebab86bcfe /gdb/x86-64-tdep.c
parenta338618604d020a6e8bde2f5e298a7e41abe290c (diff)
downloadgdb-2b5e07495d88a5301fa2d3ba7780246e79582c51.zip
gdb-2b5e07495d88a5301fa2d3ba7780246e79582c51.tar.gz
gdb-2b5e07495d88a5301fa2d3ba7780246e79582c51.tar.bz2
* x86-64-tdep.c (X86_64_NUM_SAVED_REGS): Set to X86_64_NUM_GREGS.
(x86_64_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers. * x86-64-linux-tdep.c (x86_64_linux_sc_reg_offset): New variable. (x86_64_linux_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r--gdb/x86-64-tdep.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index 560fe98..7bcabfd 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -787,7 +787,7 @@ x86_64_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
/* The maximum number of saved registers. This should include %rip. */
-#define X86_64_NUM_SAVED_REGS 17
+#define X86_64_NUM_SAVED_REGS X86_64_NUM_GREGS
struct x86_64_frame_cache
{
@@ -1035,6 +1035,7 @@ x86_64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
CORE_ADDR addr;
char buf[8];
+ int i;
if (*this_cache)
return *this_cache;
@@ -1045,8 +1046,11 @@ x86_64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
cache->base = extract_unsigned_integer (buf, 8) - 8;
addr = tdep->sigcontext_addr (next_frame);
- cache->saved_regs[X86_64_RIP_REGNUM] = addr + tdep->sc_pc_offset;
- cache->saved_regs[X86_64_RSP_REGNUM] = addr + tdep->sc_sp_offset;
+ gdb_assert (tdep->sc_reg_offset);
+ gdb_assert (tdep->sc_num_regs <= X86_64_NUM_SAVED_REGS);
+ for (i = 0; i < tdep->sc_num_regs; i++)
+ if (tdep->sc_reg_offset[i] != -1)
+ cache->saved_regs[i] = addr + tdep->sc_reg_offset[i];
*this_cache = cache;
return cache;