aboutsummaryrefslogtreecommitdiff
path: root/gdb/mn10200-tdep.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1997-02-11 19:31:29 +0000
committerJeff Law <law@redhat.com>1997-02-11 19:31:29 +0000
commit25de138b06f6cea850bfe352a6b3e00fbf60fd87 (patch)
treeb692c0e5d330c42f6ed1a9b6c025bb6a2e88f877 /gdb/mn10200-tdep.c
parentf9114af581291362a099dacdad35499bbe0aa400 (diff)
downloadgdb-25de138b06f6cea850bfe352a6b3e00fbf60fd87.zip
gdb-25de138b06f6cea850bfe352a6b3e00fbf60fd87.tar.gz
gdb-25de138b06f6cea850bfe352a6b3e00fbf60fd87.tar.bz2
* mn10200-tdep.c (mn10200_push_arguments): Stack only needs to
be two byte aligned. Round argument sizes up to two byte boundary. Write out args in two byte hunks. (mn10200_push_return_address): Implement. * config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE): Abort for structures > 8 bytes (temporary). (STORE_RETURN_VALUE): Likewise. (CALL_DUMMY): No longer undefine. (USE_STRUCT_CONVENTION): Use for args > 8 bytes. (REG_STRUCT_HAS_ADDR): Define. Inferior function calls for the mn10200.
Diffstat (limited to 'gdb/mn10200-tdep.c')
-rw-r--r--gdb/mn10200-tdep.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c
index 11c03e9..8c3812d 100644
--- a/gdb/mn10200-tdep.c
+++ b/gdb/mn10200-tdep.c
@@ -530,15 +530,15 @@ mn10200_push_arguments (nargs, args, sp, struct_return, struct_addr)
int stack_offset = 0;
/* This should be a nop, but align the stack just in case something
- went wrong. */
- sp &= ~3;
+ went wrong. Stacks are two byte aligned on the mn10200. */
+ sp &= ~1;
/* Now make space on the stack for the args.
XXX This doesn't appear to handle pass-by-invisible reference
arguments. */
for (argnum = 0; argnum < nargs; argnum++)
- len += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
+ len += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 1) & ~1);
/* Allocate stack space. */
sp -= len;
@@ -567,11 +567,11 @@ mn10200_push_arguments (nargs, args, sp, struct_return, struct_addr)
while (len > 0)
{
/* XXX This looks wrong; we can have one and two byte args. */
- write_memory (sp + stack_offset, val, 4);
+ write_memory (sp + stack_offset, val, 2);
- len -= 4;
- val += 4;
- stack_offset += 4;
+ len -= 2;
+ val += 2;
+ stack_offset += 2;
}
args++;
}
@@ -588,8 +588,11 @@ mn10200_push_return_address (pc, sp)
CORE_ADDR pc;
CORE_ADDR sp;
{
+ unsigned char buf[4];
- return sp;
+ store_unsigned_integer (buf, 4, CALL_DUMMY_ADDRESS ());
+ write_memory (sp - 4, buf, 4);
+ return sp - 4;
}
/* Function: frame_saved_pc