diff options
author | Mark Kettenis <kettenis@gnu.org> | 2004-01-10 17:48:15 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2004-01-10 17:48:15 +0000 |
commit | 6470d250697a88ab127acaa9e63adc1c5de56ea6 (patch) | |
tree | ac3826a58ffd67b718cb6a805bed274f5e3686b5 /gdb/x86-64-tdep.c | |
parent | 562c50c21805565c3fc31631a05fc72ee6a328d2 (diff) | |
download | gdb-6470d250697a88ab127acaa9e63adc1c5de56ea6.zip gdb-6470d250697a88ab127acaa9e63adc1c5de56ea6.tar.gz gdb-6470d250697a88ab127acaa9e63adc1c5de56ea6.tar.bz2 |
* x86-64-tdep.c (amd64_push_arguments): Add struct_return
argument. Use it to reserve a register if necessary.
(amd64_push_dummy_call): Pass STRUCT_RETURN in call to
amd64_push_arguments.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r-- | gdb/x86-64-tdep.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index c3bb166..242d597 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -481,7 +481,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *type, static CORE_ADDR amd64_push_arguments (struct regcache *regcache, int nargs, - struct value **args, CORE_ADDR sp) + struct value **args, CORE_ADDR sp, int struct_return) { static int integer_regnum[] = { @@ -505,6 +505,10 @@ amd64_push_arguments (struct regcache *regcache, int nargs, int sse_reg = 0; int i; + /* Reserve a register for the "hidden" argument. */ + if (struct_return) + integer_reg++; + for (i = 0; i < nargs; i++) { struct type *type = VALUE_TYPE (args[i]); @@ -613,7 +617,7 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, char buf[8]; /* Pass arguments. */ - sp = amd64_push_arguments (regcache, nargs, args, sp); + sp = amd64_push_arguments (regcache, nargs, args, sp, struct_return); /* Pass "hidden" argument". */ if (struct_return) |