import gdb-1999-07-05 snapshot
[deliverable/binutils-gdb.git] / gdb / mn10300-tdep.c
index 795e68586b69c07ef5d5397eacb19c5885769d75..c758d7748550c77c12112a84c478001d0157c7dd 100644 (file)
@@ -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)
@@ -229,7 +275,9 @@ mn10300_analyze_prologue (fi, pc)
   /* Do nothing if we couldn't find the start of this function or if we're
      stopped at the first instruction in the prologue.  */
   if (status == 0)
-    return pc;
+    {
+      return pc;
+    }
 
   /* If we're in start, then give up.  */
   if (strcmp (name, "start") == 0)
This page took 0.028887 seconds and 4 git commands to generate.