Changes to implement the -mapped and -readnow options for commands that
[binutils-gdb.git] / gdb / remote-vx.c
index 7b00a686e64d9bc87ce7fbda0e5c957625a76374..8e90cb52ff6ff30db6dd4a72e97a16fdc3963d1e 100644 (file)
@@ -1,5 +1,5 @@
 /* Memory-access and commands for remote VxWorks processes, for GDB.
-   Copyright (C) 1990-1991  Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
    Contributed by Wind River Systems and Cygnus Support.
 
 This file is part of GDB.
@@ -19,7 +19,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
-#include "param.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
@@ -29,7 +28,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "symtab.h"
 #include "symfile.h"           /* for struct complaint */
 
-#include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <signal.h>
@@ -48,11 +46,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "xdr_rdb.h"
 #include "dbgRpcLib.h"
 
-/* get rid of value.h if possible */
-#include <value.h>
 #include <symtab.h>
-extern value call_function_by_hand ();
+
 extern void symbol_file_command ();
 extern int stop_soon_quietly;          /* for wait_for_inferior */
 
@@ -223,10 +218,6 @@ vx_create_inferior (exec_file, args, env)
   push_target (&vx_run_ops);
   inferior_pid = taskStart.pid;
 
-#if defined (START_INFERIOR_HOOK)
-  START_INFERIOR_HOOK ();
-#endif
-
   /* We will get a trace trap after one instruction.
      Insert breakpoints and continue.  */
 
@@ -239,8 +230,6 @@ vx_create_inferior (exec_file, args, env)
   /* Install inferior's terminal modes.  */
   target_terminal_inferior ();
 
-  /* remote_start(args); */
-  /* trap_expected = 0; */
   stop_soon_quietly = 1;
   wait_for_inferior ();                /* Get the task spawn event */
   stop_soon_quietly = 0;
@@ -654,9 +643,9 @@ vx_files_info ()
 void
 vx_run_files_info ()
 {
-  printf ("\tRunning %s VxWorks process 0x%x", 
+  printf ("\tRunning %s VxWorks process %s", 
          vx_running? "child": "attached",
-         inferior_pid);
+         local_hex_string(inferior_pid));
   if (vx_running)
     printf (", function `%s'", vx_running);
   printf(".\n");
@@ -726,7 +715,7 @@ vx_load_command (arg_string, from_tty)
   immediate_quit--;
 
   /* FIXME, for now we ignore data_addr and bss_addr.  */
-  symbol_file_add (arg_string, from_tty, text_addr, 0);
+  (void) symbol_file_add (arg_string, from_tty, text_addr, 0, 0);
 }
 
 #ifdef FIXME  /* Not ready for prime time */
@@ -984,7 +973,7 @@ vx_wait (status)
          sleep_ms (200);       /* FIXME Don't kill the network too badly */
        }
       else if (pid != inferior_pid)
-       fatal ("Bad pid for debugged task: 0x%x\n", pid);
+       fatal ("Bad pid for debugged task: %s\n", local_hex_string(pid));
     } while (pid == 0);
 
   /* FIXME, eventually do more then SIGTRAP on everything...  */
@@ -1019,6 +1008,7 @@ vx_wait (status)
 
     case EVENT_ZERO_DIV:       /* Division by zero */
       WSETSTOP (w, SIGFPE);    /* Like Unix, call it a float exception. */
+      break;
 
     case EVENT_SIGNAL:
       /* The target is not running Unix, and its
@@ -1049,7 +1039,7 @@ add_symbol_stub (arg)
   struct ldfile *pLoadFile = (struct ldfile *)arg;
 
   printf("\t%s: ", pLoadFile->name);
-  symbol_file_add (pLoadFile->name, 0, pLoadFile->txt_addr, 0);
+  (void) symbol_file_add (pLoadFile->name, 0, pLoadFile->txt_addr, 0, 0);
   printf ("ok\n");
   return 1;
 }
@@ -1178,7 +1168,7 @@ vx_attach (args, from_tty)
     error ("Invalid process-id -- give a single number in decimal or 0xhex");
 
   if (from_tty)
-      printf ("Attaching pid 0x%x.\n", pid);
+      printf ("Attaching pid %s.\n", local_hex_string(pid));
 
   bzero ((char *)&ptrace_in,  sizeof (ptrace_in));
   bzero ((char *)&ptrace_out, sizeof (ptrace_out));
@@ -1198,10 +1188,6 @@ vx_attach (args, from_tty)
   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
@@ -1244,7 +1230,7 @@ vx_detach (args, from_tty)
     error ("Argument given to VxWorks \"detach\".");
 
   if (from_tty)
-      printf ("Detaching pid 0x%x.\n", inferior_pid);
+      printf ("Detaching pid %s.\n", local_hex_string(inferior_pid));
 
   if (args)            /* FIXME, should be possible to leave suspended */
     signal = atoi (args);
@@ -1281,7 +1267,7 @@ vx_kill (args, from_tty)
     error ("Argument given to VxWorks \"kill\".");
 
   if (from_tty)
-      printf ("Killing pid 0x%x.\n", inferior_pid);
+      printf ("Killing pid %s.\n", local_hex_string(inferior_pid));
 
   bzero ((char *)&ptrace_in,  sizeof (ptrace_in));
   bzero ((char *)&ptrace_out, sizeof (ptrace_out));
@@ -1445,7 +1431,6 @@ Specify the name of the machine to connect to.",
        0, 0, 0, 0, 0,  /* terminal stuff */
        0, /* vx_kill, */
        vx_load_command,
-       0,  /* call_function */
        vx_lookup_symbol,
        vx_create_inferior, 0,  /* mourn_inferior */
        core_stratum, 0, /* next */
@@ -1468,7 +1453,6 @@ struct target_ops vx_run_ops = {
        0, 0, 0, 0, 0,  /* terminal stuff */
        vx_kill,
        vx_load_command,
-       call_function_by_hand,  /* FIXME, calling fns is maybe botched? */
        vx_lookup_symbol,
        0, vx_mourn_inferior,
        process_stratum, 0, /* next */