diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2012-09-26 07:52:48 +0000 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2012-09-26 07:52:48 +0000 |
commit | 8f8a23a2c397294ab562c6cf7020679f85b921ec (patch) | |
tree | 778b8da141ef8d1736fcf57813d8350844636760 /gdb/vax-tdep.c | |
parent | 8ae551cf475ac573cd7d43ad46cfb81c52e58f6e (diff) | |
download | gdb-8f8a23a2c397294ab562c6cf7020679f85b921ec.zip gdb-8f8a23a2c397294ab562c6cf7020679f85b921ec.tar.gz gdb-8f8a23a2c397294ab562c6cf7020679f85b921ec.tar.bz2 |
* amd64-tdep.c (amd64_return_value): Use TYPE_LENGTH directly.
* bfin-tdep.c (bfin_extract_return_value): Likewise.
(bfin_store_return_value): Likewise.
* cris-tdep.c (cris_store_return_value): Likewise.
(cris_extract_return_value): Likewise.
* h8300-tdep.c (h8300_extract_return_value): Likewise.
* hppa-tdep.c (hppa64_return_value): Likewise.
* lm32-tdep.c (lm32_store_return_value): Likewise.
* microblaze-tdep.c (microblaze_store_return_value): Likewise.
* spu-tdep.c (spu_value_from_register): Likewise.
* vax-tdep.c (vax_return_value): Likewise.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r-- | gdb/vax-tdep.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 550b56b..e3ac15d 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -208,7 +208,6 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); gdb_byte buf[8]; if (TYPE_CODE (type) == TYPE_CODE_STRUCT @@ -224,7 +223,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, ULONGEST addr; regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); - read_memory (addr, readbuf, len); + read_memory (addr, readbuf, TYPE_LENGTH (type)); } return RETURN_VALUE_ABI_RETURNS_ADDRESS; @@ -234,16 +233,16 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, { /* Read the contents of R0 and (if necessary) R1. */ regcache_cooked_read (regcache, VAX_R0_REGNUM, buf); - if (len > 4) + if (TYPE_LENGTH (type) > 4) regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4); - memcpy (readbuf, buf, len); + memcpy (readbuf, buf, TYPE_LENGTH (type)); } if (writebuf) { /* Read the contents to R0 and (if necessary) R1. */ - memcpy (buf, writebuf, len); + memcpy (buf, writebuf, TYPE_LENGTH (type)); regcache_cooked_write (regcache, VAX_R0_REGNUM, buf); - if (len > 4) + if (TYPE_LENGTH (type) > 4) regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4); } |