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/sparc-tdep.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gdb/sparc-tdep.c') diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 70053f4..91cf391 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1496,10 +1496,17 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, static enum return_value_convention sparc32_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, - gdb_byte *readbuf, const gdb_byte *writebuf) + struct value **read_value, const gdb_byte *writebuf) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + gdb_byte *readbuf = nullptr; + if (read_value != nullptr) + { + *read_value = allocate_value (type); + readbuf = value_contents_raw (*read_value).data (); + } + /* The psABI says that "...every stack frame reserves the word at %fp+64. If a function returns a structure, union, or quad-precision value, this word should hold the address of the @@ -1853,7 +1860,7 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_code (gdbarch, sparc32_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, sparc32_push_dummy_call); - set_gdbarch_return_value (gdbarch, sparc32_return_value); + set_gdbarch_return_value_as_value (gdbarch, sparc32_return_value); set_gdbarch_stabs_argument_has_addr (gdbarch, sparc32_stabs_argument_has_addr); -- cgit v1.1