Patchwork [01/15] Call cooked_read in ppu2spu_prev_register

login
register
mail settings
Submitter Yao Qi
Date Dec. 1, 2017, 10:47 a.m.
Message ID <1512125286-29788-2-git-send-email-yao.qi@linaro.org>
Download mbox | patch
Permalink /patch/24669/
State New
Headers show

Comments

Yao Qi - Dec. 1, 2017, 10:47 a.m.
The code in ppu2spu_prev_register is in fact regcache_cooked_read,
because spu doesn't have gdbarch method pseudo_register_read_value.

gdb:

2017-11-06  Yao Qi  <yao.qi@linaro.org>

	* ppc-linux-tdep.c (ppu2spu_prev_register): Call cooked_read.
---
 gdb/ppc-linux-tdep.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
Yao Qi - Jan. 16, 2018, 4:19 p.m.
Yao Qi <qiyaoltc@gmail.com> writes:

> The code in ppu2spu_prev_register is in fact regcache_cooked_read,
> because spu doesn't have gdbarch method pseudo_register_read_value.
>
> gdb:
>
> 2017-11-06  Yao Qi  <yao.qi@linaro.org>
>
> 	* ppc-linux-tdep.c (ppu2spu_prev_register): Call cooked_read.

Hi Ulrich,
Can you review this patch?
Yao Qi - Jan. 18, 2018, 12:22 p.m.
On Tue, Jan 16, 2018 at 6:05 PM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
>
> Yes, this patch is OK.
>

Thanks, pushed.

Patch

diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 0e43a64..70e5b95 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1269,11 +1269,7 @@  ppu2spu_prev_register (struct frame_info *this_frame,
 
   buf = (gdb_byte *) alloca (register_size (gdbarch, regnum));
 
-  if (regnum < gdbarch_num_regs (gdbarch))
-    regcache_raw_read (cache->regcache, regnum, buf);
-  else
-    gdbarch_pseudo_register_read (gdbarch, cache->regcache, regnum, buf);
-
+  cache->regcache->cooked_read (regnum, buf);
   return frame_unwind_got_bytes (this_frame, regnum, buf);
 }