This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdbarch software_single_step frame_info to regcache: alpha
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 22 Nov 2016 14:32:13 -0000
- Subject: [binutils-gdb] gdbarch software_single_step frame_info to regcache: alpha
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ab2d0874025af6ee858b32c576f2461c0a1df3d
commit 7ab2d0874025af6ee858b32c576f2461c0a1df3d
Author: Yao Qi <yao.qi@linaro.org>
Date: Tue Nov 22 14:05:04 2016 +0000
gdbarch software_single_step frame_info to regcache: alpha
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* alpha-tdep.c (alpha_deal_with_atomic_sequence): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
(alpha_next_pc): Replace parameter frame with regcache.
Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
Diff:
---
gdb/ChangeLog | 9 +++++++++
gdb/alpha-tdep.c | 20 +++++++++++---------
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4f44ea5..63a594b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2016-11-22 Yao Qi <yao.qi@linaro.org>
+ * alpha-tdep.c (alpha_deal_with_atomic_sequence): Call
+ get_regcache_arch instead of get_frame_arch. Call
+ regcache_read_pc instead of get_frame_pc.
+ (alpha_next_pc): Replace parameter frame with regcache.
+ Call regcache_raw_get_unsigned instead of
+ get_frame_register_unsigned.
+
+2016-11-22 Yao Qi <yao.qi@linaro.org>
+
* aarch64-tdep.c (aarch64_software_single_step): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index a0485ef..9753c1b 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -768,8 +768,9 @@ static const int stq_c_opcode = 0x2f;
static VEC (CORE_ADDR) *
alpha_deal_with_atomic_sequence (struct frame_info *frame)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
- CORE_ADDR pc = get_frame_pc (frame);
+ struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ CORE_ADDR pc = regcache_read_pc (regcache);
CORE_ADDR breaks[2] = {-1, -1};
CORE_ADDR loc = pc;
CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence. */
@@ -1597,9 +1598,9 @@ fp_register_sign_bit (LONGEST reg)
the target of the coming instruction and breakpoint it. */
static CORE_ADDR
-alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
+alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
unsigned int insn;
unsigned int op;
int regno;
@@ -1615,7 +1616,7 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
{
/* Jump format: target PC is:
RB & ~3 */
- return (get_frame_register_unsigned (frame, (insn >> 16) & 0x1f) & ~3);
+ return (regcache_raw_get_unsigned (regcache, (insn >> 16) & 0x1f) & ~3);
}
if ((op & 0x30) == 0x30)
@@ -1646,7 +1647,7 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
regno += gdbarch_fp0_regnum (gdbarch);
}
- rav = get_frame_register_signed (frame, regno);
+ rav = regcache_raw_get_signed (regcache, regno);
switch (op)
{
@@ -1720,13 +1721,14 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
VEC (CORE_ADDR) *
alpha_software_single_step (struct frame_info *frame)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR pc;
VEC (CORE_ADDR) *next_pcs = NULL;
- pc = get_frame_pc (frame);
+ pc = regcache_read_pc (regcache);
- VEC_safe_push (CORE_ADDR, next_pcs, alpha_next_pc (frame, pc));
+ VEC_safe_push (CORE_ADDR, next_pcs, alpha_next_pc (regcache, pc));
return next_pcs;
}