aboutsummaryrefslogtreecommitdiff
path: root/gdb/vax-tdep.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2012-09-27 10:40:01 +0000
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2012-09-27 10:40:01 +0000
commitbad43aa52e2d7018830ae79c522f74b4dc3260e4 (patch)
treee3b8a6d81c3fa243cf0173de35bca957e7643612 /gdb/vax-tdep.c
parent63375b7438a788834187519e033e01cfdbd8d373 (diff)
downloadgdb-bad43aa52e2d7018830ae79c522f74b4dc3260e4.zip
gdb-bad43aa52e2d7018830ae79c522f74b4dc3260e4.tar.gz
gdb-bad43aa52e2d7018830ae79c522f74b4dc3260e4.tar.bz2
* amd64-tdep.c (amd64_return_value): Revert previous change
that used 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index e3ac15d..550b56b 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -208,6 +208,7 @@ 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
@@ -223,7 +224,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, TYPE_LENGTH (type));
+ read_memory (addr, readbuf, len);
}
return RETURN_VALUE_ABI_RETURNS_ADDRESS;
@@ -233,16 +234,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 (TYPE_LENGTH (type) > 4)
+ if (len > 4)
regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4);
- memcpy (readbuf, buf, TYPE_LENGTH (type));
+ memcpy (readbuf, buf, len);
}
if (writebuf)
{
/* Read the contents to R0 and (if necessary) R1. */
- memcpy (buf, writebuf, TYPE_LENGTH (type));
+ memcpy (buf, writebuf, len);
regcache_cooked_write (regcache, VAX_R0_REGNUM, buf);
- if (TYPE_LENGTH (type) > 4)
+ if (len > 4)
regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4);
}