Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 12/13] gdbarch software_single_step frame_info to regcache: spu
Date: Mon, 14 Nov 2016 17:43:00 -0000	[thread overview]
Message-ID: <1479145370-11432-13-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1479145370-11432-1-git-send-email-yao.qi@linaro.org>

gdb:

2016-11-10  Yao Qi  <yao.qi@linaro.org>

	* spu-tdep.c (spu_software_single_step): Call get_regcache_arch
	instead of get_frame_arch.  Call regcache_read_pc instead of
	get_frame_pc.  Call regcache_raw_get_unsigned instead of
	get_frame_register_unsigned.
---
 gdb/spu-tdep.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 073be2d..d16b68f 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1613,7 +1613,8 @@ spu_memory_remove_breakpoint (struct gdbarch *gdbarch,
 static VEC (CORE_ADDR) *
 spu_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);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR pc, next_pc;
   unsigned int insn;
@@ -1622,7 +1623,7 @@ spu_software_single_step (struct frame_info *frame)
   ULONGEST lslr;
   VEC (CORE_ADDR) *next_pcs = NULL;
 
-  pc = get_frame_pc (frame);
+  pc = regcache_read_pc (regcache);
 
   if (target_read_memory (pc, buf, 4))
     throw_error (MEMORY_ERROR, _("Could not read instruction at %s."),
@@ -1631,7 +1632,7 @@ spu_software_single_step (struct frame_info *frame)
   insn = extract_unsigned_integer (buf, 4, byte_order);
 
   /* Get local store limit.  */
-  lslr = get_frame_register_unsigned (frame, SPU_LSLR_REGNUM);
+  lslr = regcache_raw_get_unsigned (regcache, SPU_LSLR_REGNUM);
   if (!lslr)
     lslr = (ULONGEST) -1;
 
@@ -1652,7 +1653,7 @@ spu_software_single_step (struct frame_info *frame)
       if (reg == SPU_PC_REGNUM)
 	target += SPUADDR_ADDR (pc);
       else if (reg != -1)
-	target += get_frame_register_unsigned (frame, reg) & -4;
+	target += regcache_raw_get_unsigned (regcache, reg) & -4;
 
       target = target & lslr;
       if (target != next_pc)
-- 
1.9.1


  parent reply	other threads:[~2016-11-14 17:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 17:43 [PATCH 00/13] Change gdbarch software_single_step frame_info to regcache Yao Qi
2016-11-14 17:43 ` [PATCH 13/13] " Yao Qi
2016-11-16 16:17   ` Luis Machado
2016-11-14 17:43 ` Yao Qi [this message]
2016-11-14 17:43 ` [PATCH 08/13] gdbarch software_single_step frame_info to regcache: sparc Yao Qi
2016-11-14 17:43 ` [PATCH 05/13] gdbarch software_single_step frame_info to regcache: mips Yao Qi
2016-11-14 17:43 ` [PATCH 04/13] gdbarch software_single_step frame_info to regcache: cris Yao Qi
2016-11-14 17:43 ` [PATCH 03/13] gdbarch software_single_step frame_info to regcache: alpha Yao Qi
2016-11-14 17:43 ` [PATCH 10/13] gdbarch software_single_step frame_info to regcache: rs6000 Yao Qi
2016-11-14 17:43 ` [PATCH 02/13] gdbarch software_single_step frame_info to regcache: aarch64 Yao Qi
2016-11-14 17:43 ` [PATCH 07/13] gdbarch software_single_step frame_info to regcache: nios2 Yao Qi
2016-11-14 17:43 ` [PATCH 06/13] gdbarch software_single_step frame_info to regcache: moxie Yao Qi
2016-11-14 17:43 ` [PATCH 09/13] gdbarch software_single_step frame_info to regcache: s390 Yao Qi
2016-11-14 17:43 ` [PATCH 11/13] gdbarch software_single_step frame_info to regcache: tic6x Yao Qi
2016-11-14 17:43 ` [PATCH 01/13] New regcache_raw_get_signed Yao Qi
2016-11-16 15:09   ` Luis Machado
2016-11-22  9:28     ` Yao Qi
     [not found]       ` <36110d4e-9c80-23cb-ee40-849fb155af53@codesourcery.com>
2016-11-22 14:33         ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479145370-11432-13-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox