aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-09-09 06:39:56 -0600
committerTom Tromey <tromey@adacore.com>2023-01-03 08:45:01 -0700
commit5cb0f2d5b67ce2b4f60d5ad0b0a26ef918e8244f (patch)
tree301730b1a22abe06aeab97c275dbd27ff69a15a6 /gdb/amd64-tdep.c
parentDon't let property evaluation affect the current language (diff)
downloadbinutils-gdb-5cb0f2d5b67ce2b4f60d5ad0b0a26ef918e8244f.tar.gz
binutils-gdb-5cb0f2d5b67ce2b4f60d5ad0b0a26ef918e8244f.tar.bz2
binutils-gdb-5cb0f2d5b67ce2b4f60d5ad0b0a26ef918e8244f.zip
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.
Diffstat (limited to 'gdb/amd64-tdep.c')
-rw-r--r--gdb/amd64-tdep.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 0f2dab8b479..69d1f86b47a 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -789,7 +789,7 @@ amd64_classify (struct type *type, enum amd64_reg_class theclass[2])
static enum return_value_convention
amd64_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 amd64_reg_class theclass[2];
int len = type->length ();
@@ -799,7 +799,14 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
int sse_reg = 0;
int i;
- gdb_assert (!(readbuf && writebuf));
+ gdb_assert (!(read_value && writebuf));
+
+ gdb_byte *readbuf = nullptr;
+ if (read_value != nullptr)
+ {
+ *read_value = allocate_value (type);
+ readbuf = value_contents_raw (*read_value).data ();
+ }
/* 1. Classify the return type with the classification algorithm. */
amd64_classify (type, theclass);
@@ -3236,7 +3243,7 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch,
set_gdbarch_register_to_value (gdbarch, i387_register_to_value);
set_gdbarch_value_to_register (gdbarch, i387_value_to_register);
- set_gdbarch_return_value (gdbarch, amd64_return_value);
+ set_gdbarch_return_value_as_value (gdbarch, amd64_return_value);
set_gdbarch_skip_prologue (gdbarch, amd64_skip_prologue);