diff options
Diffstat (limited to 'gdb/m32r-tdep.c')
-rw-r--r-- | gdb/m32r-tdep.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 9b89ad9..472e666 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -249,7 +249,7 @@ m32r_register_type (struct gdbarch *gdbarch, int reg_nr) static void m32r_store_return_value (struct type *type, struct regcache *regcache, - const void *valbuf) + const gdb_byte *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -261,7 +261,7 @@ m32r_store_return_value (struct type *type, struct regcache *regcache, if (len > 4) { - regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4, + regval = extract_unsigned_integer (valbuf + 4, len - 4, byte_order); regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval); } @@ -776,25 +776,24 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, static void m32r_extract_return_value (struct type *type, struct regcache *regcache, - void *dst) + gdb_byte *dst) { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - bfd_byte *valbuf = dst; int len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do anything special for small big-endian values. */ regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &tmp); - store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp); + store_unsigned_integer (dst, (len > 4 ? len - 4 : len), byte_order, tmp); /* Ignore return values more than 8 bytes in size because the m32r returns anything more than 8 bytes in the stack. */ if (len > 4) { regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp); - store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp); + store_unsigned_integer (dst + len - 4, 4, byte_order, tmp); } } |