Thu Mar 26 12:00:35 1998 Martin M. Hunt <hunt@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / remote-vx.c
index 7c2da886757a66de75cc3d1f3206d8f7ceb8161d..9fe9894bfe1bc5a9c75ab0ebf52d5098dd669acc 100644 (file)
@@ -16,7 +16,7 @@ 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 "defs.h"
 #include "frame.h"
@@ -33,7 +33,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "objfiles.h"
 #include "gdb-stabs.h"
 
-#include <string.h>
+#include "gdb_string.h"
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
@@ -381,7 +381,7 @@ net_quit ()
 
 /* Read a register or registers from the remote system.  */
 
-static void
+void
 net_read_registers (reg_buf, len, procnum)
      char *reg_buf;
      int len;
@@ -393,8 +393,8 @@ net_read_registers (reg_buf, len, procnum)
   C_bytes out_data;
   char message[100];
 
-  bzero ((char *) &ptrace_in, sizeof (ptrace_in));
-  bzero ((char *) &ptrace_out, sizeof (ptrace_out));
+  memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
+  memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
 
   /* Initialize RPC input argument structure.  */
 
@@ -414,7 +414,7 @@ net_read_registers (reg_buf, len, procnum)
     error (rpcerr);
   if (ptrace_out.status == -1)
     {
-      errno = ptrace_out.errno_val;
+      errno = ptrace_out.errno;
       sprintf (message, "reading %s registers", (procnum == PTRACE_GETREGS)
                                                 ? "general-purpose"
                                                 : "floating-point");
@@ -441,8 +441,8 @@ net_write_registers (reg_buf, len, procnum)
   C_bytes in_data;
   char message[100];
 
-  bzero ((char *) &ptrace_in, sizeof (ptrace_in));
-  bzero ((char *) &ptrace_out, sizeof (ptrace_out));
+  memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
+  memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
 
   /* Initialize RPC input argument structure.  */
 
@@ -460,7 +460,7 @@ net_write_registers (reg_buf, len, procnum)
     error (rpcerr);
   if (ptrace_out.status == -1)
     {
-      errno = ptrace_out.errno_val;
+      errno = ptrace_out.errno;
       sprintf (message, "writing %s registers", (procnum == PTRACE_SETREGS)
                                                 ? "general-purpose"
                                                 : "floating-point");
@@ -499,6 +499,7 @@ vx_xfer_memory (memaddr, myaddr, len, write, target)
   Ptrace_return ptrace_out;
   C_bytes data;
   enum ptracereq request;
+  int nleft, nxfer;
 
   memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
   memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
@@ -556,7 +557,7 @@ vx_xfer_memory (memaddr, myaddr, len, write, target)
              code chosen by the target so that a later perror () will
              say something meaningful.  */
 
-          errno = ptrace_out.errno_val;
+          errno = ptrace_out.errno;
         }
     }
 
@@ -714,9 +715,6 @@ vx_add_symbols (name, from_tty, text_addr, data_addr, bss_addr)
   ANOFFSET (offs, SECT_OFF_DATA) = data_addr - ss.data_start;
   ANOFFSET (offs, SECT_OFF_BSS) = bss_addr - ss.bss_start;
   objfile_relocate (objfile, offs);
-
-  /* Need to do this *after* things are relocated.  */
-  breakpoint_re_set ();
 }
 
 /* This function allows the addition of incrementally linked object files.  */
@@ -1251,38 +1249,15 @@ vx_attach (args, from_tty)
     }
 
   /* It worked... */
-  push_target (&vx_run_ops);
-  /* The unsigned long pid will get turned into a signed int here,
-     but it doesn't seem to matter.  inferior_pid must be signed
-     in order for other parts of GDB to work correctly.  */
-  inferior_pid = pid;
-  vx_running = 0;
-#if defined (START_INFERIOR_HOOK)
-  START_INFERIOR_HOOK ();
-#endif
-
-  mark_breakpoints_out ();
-
-  /* Set up the "saved terminal modes" of the inferior
-     based on what modes we are starting it with.  */
-
-  target_terminal_init ();
-
-  /* Install inferior's terminal modes.  */
-
-  target_terminal_inferior ();
 
-  /* We will get a task spawn event immediately.  */
+  inferior_pid = pid;
+  push_target (&vx_run_ops);
 
-  init_wait_for_inferior ();
-  clear_proceed_status ();
-  stop_soon_quietly = 1;
-  wait_for_inferior ();
-  stop_soon_quietly = 0;
-  normal_stop ();
+  if (vx_running)
+    free (vx_running);
+  vx_running = 0;
 }
 
-
 /* detach_command --
    takes a program previously attached to and detaches it.
    The program resumes execution and will no longer stop
@@ -1436,6 +1411,7 @@ Specify the name of the machine to connect to.",
   vx_create_inferior, 0,  /* mourn_inferior */
   0, /* can_run */
   0, /* notice_signals */
+  0, /* thread_alive */
   0,                           /* to_stop */
   core_stratum, 0, /* next */
   1, 1, 0, 0, 0,       /* all mem, mem, stack, regs, exec */
@@ -1461,6 +1437,7 @@ struct target_ops vx_run_ops = {
   0, vx_mourn_inferior,
   0, /* can_run */
   0, /* notice_signals */
+  0, /* thread_alive */
   0,                           /* to_stop */
   process_stratum, 0, /* next */
   0, /* all_mem--off to avoid spurious msg in "i files" */
This page took 0.02538 seconds and 4 git commands to generate.