aboutsummaryrefslogtreecommitdiff
path: root/gdb/ns32k-tdep.c
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-05-26 23:06:08 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-05-26 23:06:08 +0000
commitefb2c70e1eee2d0bffcc13fb927f8da1dbca918c (patch)
treeb48972e4e3ac838d7c4b38e08c03dca348afb00d /gdb/ns32k-tdep.c
parent7bcc927b94b3131adaa192e6d4cfe4d49ae78bf8 (diff)
downloadgdb-efb2c70e1eee2d0bffcc13fb927f8da1dbca918c.zip
gdb-efb2c70e1eee2d0bffcc13fb927f8da1dbca918c.tar.gz
gdb-efb2c70e1eee2d0bffcc13fb927f8da1dbca918c.tar.bz2
* ns32k-tdep.c (ns32k_saved_pc_after_call,
ns32k_store_struct_return, ns32k_extract_return_value, ns32k_store_return_value, ns32k_extract_struct_value_address): New functions. * config/ns32k/tm-umax.h (SAVED_PC_AFTER_CALL): Define as ns32k_saved_pc_after_call. (STORE_STRUCT_RETURN): Define as ns32k_store_struct_return. (EXTRACT_RETURN_VALUE): Define as ns32k_extract_return_value. (STORE_RETURN_VALUE): Define as ns32k_store_return_value. (EXTRACT_STRUCT_VALUE_ADDRESS): Define as ns32k_extract_struct_value_address.
Diffstat (limited to 'gdb/ns32k-tdep.c')
-rw-r--r--gdb/ns32k-tdep.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 66bce73..752e075 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -120,6 +120,17 @@ ns32k_register_virtual_type (int regno)
return (builtin_type_double);
}
+/* Immediately after a function call, return the saved PC. Can't
+ always go through the frames for this because on some systems,
+ the new frame is not set up until the new function executes some
+ instructions. */
+
+CORE_ADDR
+ns32k_saved_pc_after_call (struct frame_info *frame)
+{
+ return (read_memory_integer (read_register (SP_REGNUM), 4));
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
@@ -434,6 +445,33 @@ ns32k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
}
void
+ns32k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ /* On this machine, this is a no-op (Encore Umax didn't use GCC). */
+}
+
+void
+ns32k_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
+{
+ memcpy (valbuf,
+ regbuf + REGISTER_BYTE (TYPE_CODE (valtype) == TYPE_CODE_FLT ?
+ FP0_REGNUM : 0), TYPE_LENGTH (valtype));
+}
+
+void
+ns32k_store_return_value (struct type *valtype, char *valbuf)
+{
+ write_register_bytes (TYPE_CODE (valtype) == TYPE_CODE_FLT ?
+ FP0_REGNUM : 0, valbuf, TYPE_LENGTH (valtype));
+}
+
+CORE_ADDR
+ns32k_extract_struct_value_address (char *regbuf)
+{
+ return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
+}
+
+void
_initialize_ns32k_tdep (void)
{
tm_print_insn = print_insn_ns32k;