* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / remote-os9k.c
index c9a1a97c7f020b0e6ed51fb0be2346b110287eb9..69cf3e46dc2e55787ece4b5667c1de0d7c90ab31 100644 (file)
@@ -37,7 +37,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "gdbcore.h"
 #include "target.h"
 #include "wait.h"
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <signal.h>
 #include <string.h>
 #include <sys/types.h>
@@ -49,13 +53,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "symfile.h"
 #include "objfiles.h"
 #include "gdb-stabs.h"
-#include <termio.h>
-
-#ifdef HAVE_TERMIO
-#  define TERMINAL struct termios
-#else
-#  define TERMINAL struct sgttyb
-#endif
 
 struct monitor_ops *current_monitor;
 struct cmd_list_element *showlist;
@@ -93,19 +90,27 @@ static char readbuf[16];
 
 /* Send data to monitor.  Works just like printf. */
 static void
+#ifdef ANSI_PROTOTYPES
+printf_monitor(char *pattern, ...)
+#else
 printf_monitor(va_alist)
      va_dcl
+#endif
 {
   va_list args;
-  char *pattern;
   char buf[200];
   int i;
 
+#ifdef ANSI_PROTOTYPES
+  va_start (args, pattern);
+#else
+  char *pattern;
   va_start(args);
-
   pattern = va_arg(args, char *);
+#endif
 
   vsprintf(buf, pattern, args);
+  va_end(args);
 
   if (SERIAL_WRITE(monitor_desc, buf, strlen(buf)))
     fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno));
@@ -366,10 +371,10 @@ rombug_open(args, from_tty)
     printf("Remote %s connected to %s\n", target_shortname,
           dev_name);
 
+  rombug_fetch_registers();
+
   printf_monitor ("ov e \r");
   expect_prompt(1);
-
-  rombug_fetch_registers();
   bufaddr = 0;
   buflen = 0;
 }
@@ -763,6 +768,8 @@ rombug_write_inferior_memory (memaddr, myaddr, len)
   is_trace_mode = 0;
   expect_prompt (1);
 
+  bufaddr = 0;
+  buflen = 0;
   return len;
 }
 
This page took 0.024385 seconds and 4 git commands to generate.