1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / remote-rdi.c
index ee025850581e40b61651f1564f094948da15fe58..dba920e36f24284c3be476b2096f08821a8e9ac4 100644 (file)
@@ -42,6 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "rdi-share/adp.h"
 #include "rdi-share/hsys.h"
 
+extern int isascii PARAMS ((int));
+
 /* Prototypes for local functions */
 
 static void arm_rdi_files_info PARAMS ((struct target_ops *ignore));
@@ -128,7 +130,7 @@ arm_rdi_start_remote (dummy)
 void
 voiddummy ()
 {
-  printf("void dummy\n");
+  fprintf_unfiltered (gdb_stdout, "void dummy\n");
 }
 
 static void
@@ -137,7 +139,7 @@ myprint (arg, format, ap)
      const char *format;
      va_list ap;
 {
-  vfprintf (stdout, format, ap);
+  vfprintf_unfiltered (gdb_stdout, format, ap);
 }
 
 static void
@@ -145,7 +147,8 @@ mywritec (arg, c)
      PTR arg;
      int c;
 {
-  fputc (c, (FILE *) arg);
+  if (isascii (c))
+    fputc_unfiltered (c, gdb_stdout);
 }
 
 static int
@@ -154,7 +157,20 @@ mywrite (arg, buffer, len)
      char const *buffer;
      int len;
 {
-  return fwrite (buffer, 1, len, stdout);
+  int i;
+  char *e;
+
+  e = (char *) buffer;
+  for (i = 0; i < len; i++)
+{
+      if (isascii ((int) *e))
+        {
+          fputc_unfiltered ((int) *e, gdb_stdout);
+          e++;
+        }
+}
+
+  return len;
 }
 
 static void
@@ -207,7 +223,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
   if (rslt != adp_ok)
     error ("Could not open device \"%s\"", name);
 
-  gdb_config.bytesex = 2 | (target_byte_order == BIG_ENDIAN ? 1 : 0);
+  gdb_config.bytesex = 2 | (TARGET_BYTE_ORDER == BIG_ENDIAN ? 1 : 0);
   gdb_config.fpe = 1;
   gdb_config.rditype = 2;
   gdb_config.heartbeat_on = 1;
@@ -215,12 +231,12 @@ device is attached to the remote system (e.g. /dev/ttya).");
 
   gdb_hostif.dbgprint = myprint;
   gdb_hostif.dbgpause = mypause;
-  gdb_hostif.dbgarg = stdout;
+  gdb_hostif.dbgarg = NULL;
   gdb_hostif.writec = mywritec;
   gdb_hostif.readc = myreadc;
   gdb_hostif.write = mywrite;
   gdb_hostif.gets = mygets;
-  gdb_hostif.hostosarg = stdout;
+  gdb_hostif.hostosarg = NULL;
   gdb_hostif.reset = voiddummy;
 
   rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL);
@@ -300,8 +316,8 @@ device is attached to the remote system (e.g. /dev/ttya).");
   }
 
   printf_filtered ("Connected to ARM RDI target.\n");
-
   closed_already = 0;
+  inferior_pid = 42;
 }
 
 /* Start an inferior process and set inferior_pid to its pid.
@@ -324,7 +340,7 @@ arm_rdi_create_inferior (exec_file, args, env)
   CORE_ADDR entry_point;
 
   if (exec_file == 0 || exec_bfd == 0)
-   error ("No exec file specified.");
+   error ("No executable file specified.");
 
   entry_point = (CORE_ADDR) bfd_get_start_address (exec_bfd);
 
@@ -387,7 +403,7 @@ arm_rdi_detach (args, from_tty)
      char *args;
      int from_tty;
 {
-  /* (anything to do?) */
+  pop_target ();
 }
 
 /* Clean up connection to a remote debugger.  */
@@ -406,6 +422,7 @@ arm_rdi_close (quitting)
          printf_filtered ("RDI_close: %s\n", rdi_error_message (rslt));
        }
       closed_already = 1;
+      inferior_pid = 0;
     }
 }
 \f
@@ -953,4 +970,4 @@ _initialize_remote_rdi ()
 
 /* A little dummy to make linking with the library succeed. */
 
-Fail() {}
+int Fail() { return 0; }
This page took 0.024696 seconds and 4 git commands to generate.