Patchwork [2/2] gdb/riscv: Fix type when reading register from regcache

login
register
mail settings
Submitter Andrew Burgess
Date March 6, 2018, 2:31 p.m.
Message ID <b2970c238e24e6239760b72c924ee7dd2df9ccd1.1520346400.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/26213/
State New
Headers show

Comments

Andrew Burgess - March 6, 2018, 2:31 p.m.
Should use a ULONGEST when reading from the regcache.

gdb/ChangeLog:

	* riscv-tdep.c (riscv_return_value): Change type to ULONGEST for
	reading values from registers.
---
 gdb/ChangeLog    | 5 +++++
 gdb/riscv-tdep.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 797ca72a842..3e1ad99c673 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -2318,7 +2318,7 @@  riscv_return_value (struct gdbarch  *gdbarch,
 	    /* Return value by reference will have its address in A0.  */
 	  case riscv_arg_info::location::by_ref:
 	    {
-	      CORE_ADDR addr;
+	      ULONGEST addr;
 
 	      regcache_cooked_read_unsigned (regcache, RISCV_A0_REGNUM,
 					     &addr);