1999-02-03 Martin Hunt <hunt@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / remote-utils.c
index ba7d29712d9fc7c14c8f443358bffbfc5e0200f7..7219255bb6a867a115705ac463c34f92095b6236 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic support for remote debugging interfaces.
 
-   Copyright 1993, 1994 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -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.  */
 
 /*  This file actually contains two distinct logical "packages".  They
     are packaged together in this one file because they are typically
@@ -42,7 +42,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <ctype.h>
 
 #include "defs.h"
-#include <string.h>
+#include "gdb_string.h"
 #include "gdbcmd.h"
 #include "target.h"
 #include "serial.h"
@@ -50,6 +50,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "inferior.h" /* for generic_mourn_inferior */
 #include "remote-utils.h"
 
+
+void _initialize_sr_support PARAMS ((void));
+
 struct _sr_settings sr_settings = {
   4, /* timeout:
        remote-hms.c had 2
@@ -69,6 +72,9 @@ struct _sr_settings sr_settings = {
 
 struct gr_settings *gr_settings = NULL;
 
+static void usage PARAMS ((char *, char *));
+static void sr_com PARAMS ((char *, int));
+
 static void
 usage(proto, junk)
      char *proto;
@@ -102,8 +108,6 @@ sr_scan_args(proto, args)
   int n;
   char *p, *q;
 
-  extern int strtol();
-
   /* if no args, then nothing to do. */
   if (args == NULL || *args == '\0')
     return;
@@ -243,10 +247,12 @@ sr_pollchar()
   if (buf == SERIAL_TIMEOUT)
     buf = 0;
   if (sr_get_debug() > 0)
-    if (buf)
-      printf_unfiltered ("%c", buf);
-    else
-      printf_unfiltered ("<empty character poll>");
+    {
+      if (buf)
+        printf_unfiltered ("%c", buf);
+      else
+        printf_unfiltered ("<empty character poll>");
+    }
 
   return buf & 0x7f;
 }
@@ -382,7 +388,7 @@ sr_get_hex_word ()
    prompt from the remote is seen.
    FIXME: Can't handle commands that take input.  */
 
-void
+static void
 sr_com (args, fromtty)
      char *args;
      int fromtty;
@@ -396,6 +402,7 @@ sr_com (args, fromtty)
 
   sr_write_cr (args);
   sr_write ("\030", 1);
+  registers_changed ();
   gr_expect_prompt ();
 }
 
@@ -489,7 +496,7 @@ gr_create_inferior (execfile, args, env)
     error ("Can't pass arguments to remote process.");
 
   if (execfile == 0 || exec_bfd == 0)
-    error ("No exec file specified");
+    error ("No executable file specified");
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
   sr_check_open ();
@@ -630,63 +637,6 @@ gr_store_word (addr, word)
   dcache_poke (gr_get_dcache(), addr, word);
 }
 
-/* general purpose load a file specified on the command line
-   into target memory. */
-
-void
-gr_load_image (args, fromtty)
-     char *args;
-     int fromtty;
-{
-  bfd *abfd;
-
-  asection *s;
-  struct cleanup *old_cleanups;
-  int delta = 4096;
-  char *buffer = xmalloc (delta);
-
-  abfd = bfd_openr (args, (char *) 0);
-
-  if (!abfd)
-    perror_with_name (args);
-
-  old_cleanups = make_cleanup (bfd_close, abfd);
-
-  QUIT;
-
-  if (!bfd_check_format (abfd, bfd_object))
-    error ("It doesn't seem to be an object file.\n");
-
-  for (s = abfd->sections; s && !quit_flag; s = s->next)
-    {
-      if (bfd_get_section_flags (abfd, s) & SEC_LOAD)
-       {
-         int i;
-         printf_filtered ("%s\t: 0x%4x .. 0x%4x  ",
-                          s->name, s->vma, s->vma + s->_raw_size);
-         fflush (stdout);
-         for (i = 0; i < s->_raw_size && !quit_flag; i += delta)
-           {
-             int sub_delta = delta;
-             if (sub_delta > s->_raw_size - i)
-               sub_delta = s->_raw_size - i;
-             QUIT;
-             bfd_get_section_contents (abfd, s, buffer, i, sub_delta);
-             target_write_memory (s->vma + i, buffer, sub_delta);
-             printf_filtered ("*");
-             fflush (stdout);
-           }
-         printf_filtered ("\n");
-       }
-    }
-
-  free (buffer);
-  write_pc (bfd_get_start_address (abfd));
-  bfd_close (abfd);
-  discard_cleanups (old_cleanups);
-}
-
-
 void
 _initialize_sr_support ()
 {
This page took 0.025371 seconds and 4 git commands to generate.