From 5cb0f2d5b67ce2b4f60d5ad0b0a26ef918e8244f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 9 Sep 2022 06:39:56 -0600 Subject: Convert selected architectures to gdbarch_return_value_as_value This converts a few selected architectures to use gdbarch_return_value_as_value rather than gdbarch_return_value. The architectures are just the ones that I am able to test. This patch should not introduce any behavior changes. --- gdb/aarch64-tdep.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gdb/aarch64-tdep.c') diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 3cc0d3b..0371387 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2446,8 +2446,14 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, static enum return_value_convention aarch64_return_value (struct gdbarch *gdbarch, struct value *func_value, struct type *valtype, struct regcache *regcache, - gdb_byte *readbuf, const gdb_byte *writebuf) + struct value **read_value, const gdb_byte *writebuf) { + gdb_byte *readbuf = nullptr; + if (read_value != nullptr) + { + *read_value = allocate_value (valtype); + readbuf = value_contents_raw (*read_value).data (); + } if (valtype->code () == TYPE_CODE_STRUCT || valtype->code () == TYPE_CODE_UNION @@ -3765,7 +3771,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_dwarf2_reg_to_regnum (gdbarch, aarch64_dwarf_reg_to_regnum); /* Returning results. */ - set_gdbarch_return_value (gdbarch, aarch64_return_value); + set_gdbarch_return_value_as_value (gdbarch, aarch64_return_value); /* Disassembly. */ set_gdbarch_print_insn (gdbarch, aarch64_gdb_print_insn); -- cgit v1.1