* monitor.c (monitor_load_srec monitor_make_srec): Move all
[deliverable/binutils-gdb.git] / gdb / convex-xdep.c
index 6fbcd24d3560f489fc87606890e532ddbbf6ce94..9a3d99552ede7f23d9cfdb0f0ec23ae07768ccb0 100644 (file)
@@ -1,5 +1,5 @@
-/* Convex stuff for GDB.
-   Copyright (C) 1990-1991 Free Software Foundation, Inc.
+/* Convex host-dependent code for GDB.
+   Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -15,9 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#include <stdio.h>
 #include "defs.h"
 #include "command.h"
 #include "symtab.h"
@@ -38,7 +37,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/thread.h>
 #include <sys/proc.h>
 #include <sys/file.h>
-#include <sys/stat.h>
+#include "gdb_stat.h"
 #include <sys/mman.h>
 
 #include <convex/vmparam.h>
@@ -190,18 +189,11 @@ static int exec_trap_timer;
 
 #include "gdbcmd.h"
 
-/* Nonzero if we are debugging an attached outside process
-   rather than an inferior.  */
-
-extern int attach_flag;
-
-
-
 static struct type *vector_type ();
 static long *read_vector_register ();
 static long *read_vector_register_1 ();
 static void write_vector_register ();
-static REGISTER_TYPE read_comm_register ();
+static unsigned LONGEST read_comm_register ();
 static void write_comm_register ();
 static void convex_cont_command ();
 static void thread_continue ();
@@ -213,14 +205,15 @@ static void psw_info ();
 static sig_noop ();
 static ptr_cmp ();
 
-extern char *sys_siglist[];
 \f
 /* Execute ptrace.  Convex V7 replaced ptrace with pattach.
    Allow ptrace (0) as a no-op.  */
 
 int
 call_ptrace (request, pid, procaddr, buf)
-     int request, pid, procaddr, buf;
+     int request, pid;
+     PTRACE_ARG3_TYPE procaddr;
+     int buf;
 {
   if (request == 0)
     return;
@@ -258,6 +251,7 @@ fetch_inferior_registers (regno)
 /* Store our register values back into the inferior.
    For Convex, do this only once, right before resuming inferior.  */
 
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -288,7 +282,7 @@ read_inferior_memory (memaddr, myaddr, len)
       len -= i;
     }
   if (errno) 
-    bzero (myaddr, len);
+    memset (myaddr, '\0', len);
   return errno;
 }
 
@@ -312,6 +306,9 @@ write_inferior_memory (memaddr, myaddr, len)
    and started up.  We must do a pattach to grab it for debugging.
 
    Also, intercept the CONT command by altering its dispatch address.  */
+/* FIXME: This used to be called from a macro CREATE_INFERIOR_HOOK.
+   But now init_trace_fun is in the same place.  So re-write this to
+   use the init_trace_fun (making convex a debugging target).  */
 
 create_inferior_hook (pid)
     int pid;
@@ -382,16 +379,6 @@ kill_inferior ()
   target_mourn_inferior ();
 }
 
-/* This is used when GDB is exiting.  It gives less chance of error.*/
-
-kill_inferior_fast ()
-{
-  if (inferior_pid == 0)
-    return;
-  ioctl (inferior_fd, PIXTERMINATE, 0);
-  wait (0);
-}
-
 /* Read vector register REG, and return a pointer to the value.  */
 
 static long *
@@ -407,7 +394,7 @@ read_vector_register (reg)
       ps.pi_thread = inferior_thread;
       ioctl (inferior_fd, PIXRDVREGS, &ps);
       if (errno)
-       bzero (&vector_registers, sizeof vector_registers);
+       memset (&vector_registers, '\0', sizeof vector_registers);
     }
   else if (corechan >= 0)
     {
@@ -455,7 +442,7 @@ read_vector_register_1 (reg)
 static void
 write_vector_register (reg, element, val)
     int reg, element;
-    REGISTER_TYPE val;
+    unsigned LONGEST val;
 {
   if (have_inferior_p ())
     {
@@ -494,7 +481,7 @@ write_vector_register (reg, element, val)
 
 /* Return the contents of communication register NUM.  */ 
 
-static REGISTER_TYPE 
+static unsigned LONGEST 
 read_comm_register (num)
      int num;
 {
@@ -516,7 +503,7 @@ read_comm_register (num)
 static void
 write_comm_register (num, val)
      int num;
-     REGISTER_TYPE val;
+     unsigned LONGEST val;
 {
   if (have_inferior_p ())
     {
@@ -744,6 +731,7 @@ wait (w)
 
   select_thread (signal_stack->thread);
 
+ FIXME: need to convert from host sig.
   stop_signal = signal_stack->signo;
   stop_sigcode = signal_stack->subsig;
 
@@ -763,11 +751,11 @@ select_thread (thread)
   if (thread == inferior_thread)
     return;
 
-  bcopy (registers, thread_regs[inferior_thread], REGISTER_BYTES);
+  memcpy (thread_regs[inferior_thread], registers, REGISTER_BYTES);
   ps.pi_thread = inferior_thread = thread;
   if (have_inferior_p ())
     ioctl (inferior_fd, PISETRWTID, &ps);
-  bcopy (thread_regs[thread], registers, REGISTER_BYTES);
+  memcpy (registers, thread_regs[thread], REGISTER_BYTES);
 }
   
 /* Routine to set or clear a psw bit in the psw and also all psws
@@ -842,7 +830,7 @@ core_file_command (filename, from_tty)
       make_cleanup (free, filename);
       
       if (have_inferior_p ())
-       error ("To look at a core file, you must kill the inferior with \"kill\".");
+       error ("To look at a core file, you must kill the program with \"kill\".");
       corechan = open (filename, O_RDONLY, 0);
       if (corechan < 0)
        perror_with_name (filename);
@@ -950,9 +938,7 @@ core_file_command (filename, from_tty)
 
          printf_filtered ("thread %d received signal %d, %s\n",
                           n, thread_signal[n],
-                          thread_signal[n] < NSIG
-                          ? sys_siglist[thread_signal[n]]
-                          : "(undocumented)");
+                          safe_strsignal (thread_signal[n]));
        }
 
       /* Select an interesting thread -- also-rans died with SIGKILL,
@@ -970,8 +956,6 @@ core_file_command (filename, from_tty)
       core_aouthdr.a_magic = 0;
 
       flush_cached_frames ();
-      set_current_frame (create_new_frame (read_register (FP_REGNUM),
-                                            read_pc ()));
       select_frame (get_current_frame (), 0);
       validate_files ();
 
This page took 0.02569 seconds and 4 git commands to generate.