aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-20 10:04:12 -0600
committerTom Tromey <tromey@adacore.com>2023-10-30 07:45:39 -0600
commit47231c30a0475092cd452d6062ed06ee904e28f8 (patch)
treee6bd288b48fa2933ef9aafa250ca5aaeee313bb4
parenta0bfd1bfa6e7ecdf67bbf11defeb821d9c63e8ef (diff)
downloadgdb-47231c30a0475092cd452d6062ed06ee904e28f8.zip
gdb-47231c30a0475092cd452d6062ed06ee904e28f8.tar.gz
gdb-47231c30a0475092cd452d6062ed06ee904e28f8.tar.bz2
Fix range-type "return" command on ARM
On big-endian ARM, "return"ing from a function that returned a range type did not work. This patch strips the range type to treat the function as though it were returning the underlying type instead. Approved-By: Luis Machado <luis.machado@arm.com>
-rw-r--r--gdb/arm-tdep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 493e5b8..62412d9 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -9132,6 +9132,9 @@ arm_store_return_value (struct type *type, struct regcache *regs,
struct gdbarch *gdbarch = regs->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ while (type->code () == TYPE_CODE_RANGE)
+ type = check_typedef (type->target_type ());
+
if (type->code () == TYPE_CODE_FLT)
{
gdb_byte buf[ARM_FP_REGISTER_SIZE];