summaryrefslogtreecommitdiff
path: root/gdb/mn10300-tdep.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-06-14 18:08:47 +0000
committerJason Molenda <jmolenda@apple.com>1999-06-14 18:08:47 +0000
commit0f71a2f66f83f4c7ac139fa8d33ab882362fe861 (patch)
tree16074aaf8b9c3abda2ddf840b5b307c933298a75 /gdb/mn10300-tdep.c
parent308b1ffdedc0380e17d84260b0069593eb4f9336 (diff)
downloadbinutils-gdb-0f71a2f66f83f4c7ac139fa8d33ab882362fe861.tar.gz
import gdb-1999-06-14 snapshot
Diffstat (limited to 'gdb/mn10300-tdep.c')
-rw-r--r--gdb/mn10300-tdep.c62
1 files changed, 54 insertions, 8 deletions
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 795e68586b6..a0113edc892 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -28,14 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
#include "symfile.h"
-static char *mn10300_generic_register_names[] =
-{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
- "sp", "pc", "mdr", "psw", "lir", "lar", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "fp" };
-
-char **mn10300_register_names = mn10300_generic_register_names;
-
static CORE_ADDR mn10300_analyze_prologue PARAMS ((struct frame_info *fi,
CORE_ADDR pc));
@@ -47,6 +39,60 @@ struct frame_extra_info
int stack_size;
};
+
+static char *mn10300_generic_register_names[] =
+{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
+ "sp", "pc", "mdr", "psw", "lir", "lar", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "fp" };
+
+static char **mn10300_register_names = mn10300_generic_register_names;
+
+char *
+mn10300_register_name (i)
+ int i;
+{
+ return mn10300_register_names[i];
+}
+
+CORE_ADDR
+mn10300_saved_pc_after_call (fi)
+ struct frame_info *fi;
+{
+ return read_memory_integer (read_register (SP_REGNUM), 4);
+}
+
+void
+mn10300_extract_return_value (type, regbuf, valbuf)
+ struct type *type;
+ char *regbuf;
+ char *valbuf;
+{
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ memcpy (valbuf, regbuf + REGISTER_BYTE (4), TYPE_LENGTH (type));
+ else
+ memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (type));
+}
+
+CORE_ADDR
+mn10300_extract_struct_value_address (regbuf)
+ char *regbuf;
+{
+ return extract_address (regbuf + REGISTER_BYTE (4),
+ REGISTER_RAW_SIZE (4));
+}
+
+void
+mn10300_store_return_value (type, valbuf)
+ struct type *type;
+ char *valbuf;
+{
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ write_register_bytes (REGISTER_BYTE (4), valbuf, TYPE_LENGTH (type));
+ else
+ write_register_bytes (REGISTER_BYTE (0), valbuf, TYPE_LENGTH (type));
+}
+
static struct frame_info *analyze_dummy_frame PARAMS ((CORE_ADDR, CORE_ADDR));
static struct frame_info *
analyze_dummy_frame (pc, frame)