aboutsummaryrefslogtreecommitdiff
path: root/gdb/mn10200-tdep.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1997-02-12 00:48:47 +0000
committerJeff Law <law@redhat.com>1997-02-12 00:48:47 +0000
commitd601a41faa7be5a1b3a27222713f61ea0bb11ecd (patch)
treef5a8b8e4303489191e3d7a38ccbee0d02adcbd46 /gdb/mn10200-tdep.c
parent380c32d50df2dba5393429b52effd51b1a3c0f0f (diff)
downloadgdb-d601a41faa7be5a1b3a27222713f61ea0bb11ecd.zip
gdb-d601a41faa7be5a1b3a27222713f61ea0bb11ecd.tar.gz
gdb-d601a41faa7be5a1b3a27222713f61ea0bb11ecd.tar.bz2
* config/mn10200/tm-mn10200.h (STORE_STRUCT_RETURN): Fix.
* mn10200-tdep.c (mn10200_store_struct_return): New function. (REG_STRUCT_HAS_ADDR): Tweak. Fixes most of the structs.exp tests.
Diffstat (limited to 'gdb/mn10200-tdep.c')
-rw-r--r--gdb/mn10200-tdep.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c
index 8c3812d..d25c430 100644
--- a/gdb/mn10200-tdep.c
+++ b/gdb/mn10200-tdep.c
@@ -594,6 +594,30 @@ mn10200_push_return_address (pc, sp)
write_memory (sp - 4, buf, 4);
return sp - 4;
}
+
+/* Function: store_struct_return (addr,sp)
+ Store the structure value return address for an inferior function
+ call. */
+
+CORE_ADDR
+mn10200_store_struct_return (addr, sp)
+ CORE_ADDR addr;
+ CORE_ADDR sp;
+{
+ unsigned char buf1[4];
+ unsigned char buf2[4];
+
+ /* Get the saved PC and hold onto it. */
+ target_read_memory (sp, buf1, 4);
+
+ /* Now push the structure value address. */
+ store_unsigned_integer (buf2, 4, addr);
+ write_memory (sp, buf2, 4);
+
+ /* Now push the saved PC back onto the stack. */
+ target_write_memory (sp - 4, buf1, 4);
+ return sp - 4;
+}
/* Function: frame_saved_pc
Find the caller of this frame. We do this by seeing if RP_REGNUM