aboutsummaryrefslogtreecommitdiff
path: root/gdb/cris-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/cris-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/cris-tdep.c')
-rw-r--r--gdb/cris-tdep.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 48c8f94..6739037 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1662,20 +1662,20 @@ cris_store_return_value (struct type *type, struct regcache *regcache,
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
+ int len = TYPE_LENGTH (type);
- if (TYPE_LENGTH (type) <= 4)
+ if (len <= 4)
{
/* Put the return value in R10. */
- val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
+ val = extract_unsigned_integer (valbuf, len, byte_order);
regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val);
}
- else if (TYPE_LENGTH (type) <= 8)
+ else if (len <= 8)
{
/* Put the return value in R10 and R11. */
val = extract_unsigned_integer (valbuf, 4, byte_order);
regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val);
- val = extract_unsigned_integer ((char *)valbuf + 4,
- TYPE_LENGTH (type) - 4, byte_order);
+ val = extract_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order);
regcache_cooked_write_unsigned (regcache, ARG2_REGNUM, val);
}
else
@@ -1833,21 +1833,21 @@ cris_extract_return_value (struct type *type, struct regcache *regcache,
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
+ int len = TYPE_LENGTH (type);
- if (TYPE_LENGTH (type) <= 4)
+ if (len <= 4)
{
/* Get the return value from R10. */
regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val);
- store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, val);
+ store_unsigned_integer (valbuf, len, byte_order, val);
}
- else if (TYPE_LENGTH (type) <= 8)
+ else if (len <= 8)
{
/* Get the return value from R10 and R11. */
regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val);
store_unsigned_integer (valbuf, 4, byte_order, val);
regcache_cooked_read_unsigned (regcache, ARG2_REGNUM, &val);
- store_unsigned_integer ((char *)valbuf + 4, TYPE_LENGTH (type) - 4,
- byte_order, val);
+ store_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order, val);
}
else
error (_("cris_extract_return_value: type length too large"));