diff options
author | Mark Kettenis <kettenis@gnu.org> | 2001-03-26 12:11:14 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2001-03-26 12:11:14 +0000 |
commit | 22f8ba577413fda5817e1eac7605a56c5cbfccdb (patch) | |
tree | c6f0da847979140fa4f9a304ed3d339af504c75c /gdb/i386-tdep.c | |
parent | e9c75b65b11ff47a78c1c46c4a2a482f4d4b42fd (diff) | |
download | gdb-22f8ba577413fda5817e1eac7605a56c5cbfccdb.zip gdb-22f8ba577413fda5817e1eac7605a56c5cbfccdb.tar.gz gdb-22f8ba577413fda5817e1eac7605a56c5cbfccdb.tar.bz2 |
* i386-tdep.c (i386_push_arguments, i386_store_struct_return): New
functions.
* config/i386/tm-i386.h (PUSH_ARGUMENTS): New macro.
(STORE_STRUCT_RETURN): Redefine in terms of
i386_store_struct_return.
(i386_push_arguments, i386_store_struct_return): New prototypes.
* config/i386/tm-i386v.h (STORE_STRUCT_RETURN): Remove. It's
definition was identical to the definition in "i386/tm-i386.h" so
the new definition should suffice too.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 6d5a777..a5d3ef7 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -694,6 +694,30 @@ get_longjmp_target (CORE_ADDR *pc) #endif /* GET_LONGJMP_TARGET */ +CORE_ADDR +i386_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) +{ + sp = default_push_arguments (nargs, args, sp, struct_return, struct_addr); + + if (struct_return) + { + char buf[4]; + + sp -= 4; + store_address (buf, 4, struct_addr); + write_memory (sp, buf, 4); + } + + return sp; +} + +void +i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) +{ + /* Do nothing. Everything was already done by i386_push_arguments. */ +} + /* These registers are used for returning integers (and on some targets also for returning `struct' and `union' values when their size and alignment match an integer type). */ |