From 2ae02b477b5068d2598f45fc416fc525fd4f9a4b Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 8 Oct 2007 12:48:05 +0000 Subject: [PATCH] 2007-10-08 Markus Deuling * amd64-tdep.c (amd64_frame_prev_register, amd64_sigtramp_frame_cache): Use get_regcache_arch or get_frame_arch to get at the current architecture by regcache or by frame, respectively. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Likewise. * amd64-nat.c (amd64_supply_native_gregset) (amd64_collect_native_gregset): Replace current_gdbarch by gdbarch. --- gdb/ChangeLog | 9 +++++++++ gdb/amd64-linux-tdep.c | 3 ++- gdb/amd64-nat.c | 8 ++++---- gdb/amd64-tdep.c | 7 ++++--- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b50e151a23..644265718a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2007-10-08 Markus Deuling + + * amd64-tdep.c (amd64_frame_prev_register, amd64_sigtramp_frame_cache): + Use get_regcache_arch or get_frame_arch to get at the current + architecture by regcache or by frame, respectively. + * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Likewise. + * amd64-nat.c (amd64_supply_native_gregset) + (amd64_collect_native_gregset): Replace current_gdbarch by gdbarch. + 2007-10-08 Markus Deuling * alpha-tdep.c (alpha_register_reggroup_p): Replace current_gdbarch by diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index e26bdd5577..aeb6600f23 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -154,7 +154,8 @@ amd64_linux_sigcontext_addr (struct frame_info *next_frame) CORE_ADDR sp; gdb_byte buf[8]; - frame_unwind_register (next_frame, gdbarch_sp_regnum (current_gdbarch), buf); + frame_unwind_register (next_frame, + gdbarch_sp_regnum (get_frame_arch (next_frame)), buf); sp = extract_unsigned_integer (buf, 8); /* The sigcontext structure is part of the user context. A pointer diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c index c641e89d00..9c6965a73b 100644 --- a/gdb/amd64-nat.c +++ b/gdb/amd64-nat.c @@ -98,8 +98,8 @@ amd64_supply_native_gregset (struct regcache *regcache, if (gdbarch_ptr_bit (gdbarch) == 32) num_regs = amd64_native_gregset32_num_regs; - if (num_regs > gdbarch_num_regs (current_gdbarch)) - num_regs = gdbarch_num_regs (current_gdbarch); + if (num_regs > gdbarch_num_regs (gdbarch)) + num_regs = gdbarch_num_regs (gdbarch); for (i = 0; i < num_regs; i++) { @@ -145,8 +145,8 @@ amd64_collect_native_gregset (const struct regcache *regcache, } } - if (num_regs > gdbarch_num_regs (current_gdbarch)) - num_regs = gdbarch_num_regs (current_gdbarch); + if (num_regs > gdbarch_num_regs (gdbarch)) + num_regs = gdbarch_num_regs (gdbarch); for (i = 0; i < num_regs; i++) { diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 953394a22d..3ca8dde7af 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -863,12 +863,13 @@ amd64_frame_prev_register (struct frame_info *next_frame, void **this_cache, enum lval_type *lvalp, CORE_ADDR *addrp, int *realnump, gdb_byte *valuep) { + struct gdbarch *gdbarch = get_frame_arch (next_frame); struct amd64_frame_cache *cache = amd64_frame_cache (next_frame, this_cache); gdb_assert (regnum >= 0); - if (regnum == gdbarch_sp_regnum (current_gdbarch) && cache->saved_sp) + if (regnum == gdbarch_sp_regnum (gdbarch) && cache->saved_sp) { *optimizedp = 0; *lvalp = not_lval; @@ -892,7 +893,7 @@ amd64_frame_prev_register (struct frame_info *next_frame, void **this_cache, { /* Read the value in from memory. */ read_memory (*addrp, valuep, - register_size (current_gdbarch, regnum)); + register_size (gdbarch, regnum)); } return; } @@ -929,7 +930,7 @@ static struct amd64_frame_cache * amd64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache) { struct amd64_frame_cache *cache; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame)); CORE_ADDR addr; gdb_byte buf[8]; int i; -- 2.34.1