aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2006-08-01 18:27:52 +0000
committerMark Kettenis <kettenis@gnu.org>2006-08-01 18:27:52 +0000
commit7c00367c289eb2225a05146845d3b5b445e1a302 (patch)
tree7be53b7077fde739b71da66d934abe5fef49d809 /gdb/arm-tdep.c
parentcfde7f7078be39a3f4c99536a0ec1eb34ed04d17 (diff)
downloadgdb-7c00367c289eb2225a05146845d3b5b445e1a302.zip
gdb-7c00367c289eb2225a05146845d3b5b445e1a302.tar.gz
gdb-7c00367c289eb2225a05146845d3b5b445e1a302.tar.bz2
* arm-tdep.h (enum struct_return): New.
(struct gdbarch_tdep): Add struct_return member. * arm-tdep.c (arm_return_value): Return RETURN_VALUE_STRUCT_CONVENTION for aggregates when the ABI uses pcc_struct_return. (arm_gdbarch_init): Default to reg_struct_return. * armobsd-tdep.c (armobsd_init_abi): Set pcc_struct_return.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index c5c903b..a8c00d8 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -2259,11 +2259,14 @@ arm_return_value (struct gdbarch *gdbarch, struct type *valtype,
struct regcache *regcache, gdb_byte *readbuf,
const gdb_byte *writebuf)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
{
- if (arm_return_in_memory (gdbarch, valtype))
+ if (tdep->struct_return == pcc_struct_return
+ || arm_return_in_memory (gdbarch, valtype))
return RETURN_VALUE_STRUCT_CONVENTION;
}
@@ -2757,6 +2760,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->lowest_pc = 0x20;
tdep->jb_pc = -1; /* Longjump support not enabled by default. */
+ /* The default, for both APCS and AAPCS, is to return small
+ structures in registers. */
+ tdep->struct_return = reg_struct_return;
+
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
set_gdbarch_frame_align (gdbarch, arm_frame_align);