* corelow.c, exec.c, inftarg.c, m3-nat.c, op50-rom.c, procfs.c,
[deliverable/binutils-gdb.git] / gdb / z8k-tdep.c
index 65f73f07aedb0df7955a3478411eeae07761cde1..dba58cf33f373fb9c3af3b8247f9e7fecec19d68 100644 (file)
@@ -28,7 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "symtab.h"
 #include "gdbcmd.h"
 #include "gdbtypes.h"
-
+#include "dis-asm.h"
 /* Return the saved PC from this frame.
 
    If the frame has a memory copy of SRP_REGNUM, use that.  If not,
@@ -189,7 +189,7 @@ get_frame_saved_regs (frame_info, frame_saved_regs)
   CORE_ADDR pc;
   int w;
 
-  bzero (frame_saved_regs, sizeof (*frame_saved_regs));
+  memset (frame_saved_regs, '\0', sizeof (*frame_saved_regs));
   pc = get_pc_function_start (frame_info->pc);
 
 /* wander down the instruction stream */
@@ -206,21 +206,19 @@ z8k_push_dummy_frame ()
 int
 print_insn (memaddr, stream)
      CORE_ADDR memaddr;
-     FILE *stream;
+     GDB_FILE *stream;
 {
-  char temp[20];
   disassemble_info info;
 
   GDB_INIT_DISASSEMBLE_INFO(info, stream);
 
-  read_memory (memaddr, temp, 20);
   if (BIG)
     {
-      return print_insn_z8001 (memaddr, temp, &info);
+      return print_insn_z8001 ((bfd_vma) memaddr, &info);
     }
   else
     {
-      return print_insn_z8002 (memaddr, temp, &info);
+      return print_insn_z8002 ((bfd_vma) memaddr, &info);
     }
 }
 
@@ -235,16 +233,15 @@ NEXT_PROLOGUE_INSN (addr, lim, pword1)
      CORE_ADDR lim;
      short *pword1;
 {
+  char buf[2];
   if (addr < lim + 8)
     {
-      read_memory (addr, pword1, sizeof (*pword1));
-      SWAP_TARGET_AND_HOST (pword1, sizeof (short));
+      read_memory (addr, buf, 2);
+      *pword1 = extract_signed_integer (buf, 2);
 
       return addr + 2;
     }
-
   return 0;
-
 }
 
 /* Put here the code to store, into a struct frame_saved_regs,
@@ -299,12 +296,6 @@ frame_find_saved_regs (fip, fsrp)
 
 }
 
-void
-addr_bits_set ()
-{
-  abort ();
-}
-
 int
 saved_pc_after_call ()
 {
@@ -361,8 +352,8 @@ print_register_hook (regno)
 
       read_relative_register_raw_bytes (regno, (char *) (l + 0));
       read_relative_register_raw_bytes (regno + 1, (char *) (l + 1));
-      printf ("\t");
-      printf ("%04x%04x", l[0], l[1]);
+      printf_unfiltered ("\t");
+      printf_unfiltered ("%04x%04x", l[0], l[1]);
     }
 
   if ((regno & 3) == 0 && regno < 16)
@@ -374,8 +365,8 @@ print_register_hook (regno)
       read_relative_register_raw_bytes (regno + 2, (char *) (l + 2));
       read_relative_register_raw_bytes (regno + 3, (char *) (l + 3));
 
-      printf ("\t");
-      printf ("%04x%04x%04x%04x", l[0], l[1], l[2], l[3]);
+      printf_unfiltered ("\t");
+      printf_unfiltered ("%04x%04x%04x%04x", l[0], l[1], l[2], l[3]);
     }
   if (regno == 15)
     {
@@ -384,37 +375,15 @@ print_register_hook (regno)
 
       read_relative_register_raw_bytes (regno, (char *) (&rval));
 
-      printf ("\n");
+      printf_unfiltered ("\n");
       for (i = 0; i < 10; i += 2)
        {
-         printf ("(sp+%d=%04x)", i, read_memory_short (rval + i));
+         printf_unfiltered ("(sp+%d=%04x)", i, read_memory_short (rval + i));
        }
     }
 
 }
 
-void
-register_convert_to_virtual (regnum, from, to)
-     unsigned char *from;
-     unsigned char *to;
-{
-  to[0] = from[0];
-  to[1] = from[1];
-  to[2] = from[2];
-  to[3] = from[3];
-}
-
-void
-register_convert_to_raw (regnum, to, from)
-     char *to;
-     char *from;
-{
-  to[0] = from[0];
-  to[1] = from[1];
-  to[2] = from[2];
-  to[3] = from[3];
-}
-
 void
 z8k_pop_frame ()
 {
@@ -430,7 +399,7 @@ z8k_set_pointer_size (newsize)
 
   if (oldsize != newsize)
     {
-      printf ("pointer size set to %d bits\n", newsize);
+      printf_unfiltered ("pointer size set to %d bits\n", newsize);
       oldsize = newsize;
       if (newsize == 32)
        {
@@ -461,15 +430,17 @@ unsegmented_command (args, from_tty)
 
 }
 
+
 static void
 set_memory (args, from_tty)
      char *args;
      int from_tty;
 {
-  printf ("\"set memory\" must be followed by the name of a memory subcommand.\n");
-  help_list (setmemorylist, "set memory ", -1, stdout);
+  printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n");
+  help_list (setmemorylist, "set memory ", -1, gdb_stdout);
 }
 
+void
 _initialize_z8ktdep ()
 {
   add_prefix_cmd ("memory", no_class, set_memory,
This page took 0.027779 seconds and 4 git commands to generate.