* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / remote-st.c
index 833aa206760cb505b2e43611abcf7e2694785175..50c5678bffad3e0058cffb5080f85e02b3727d7f 100644 (file)
@@ -38,7 +38,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>
@@ -66,18 +70,27 @@ static serial_t st2000_desc;
 /* Send data to stdebug.  Works just like printf. */
 
 static void
+#ifdef ANSI_PROTOTYPES
+printf_stdebug(char *pattern, ...)
+#else
 printf_stdebug(va_alist)
      va_dcl
+#endif
 {
   va_list args;
-  char *pattern;
   char buf[200];
 
+#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(st2000_desc, buf, strlen(buf)))
     fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno));
 }
@@ -251,10 +264,6 @@ st2000_create_inferior (execfile, args, env)
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
 
-#ifdef CREATE_INFERIOR_HOOK
-  CREATE_INFERIOR_HOOK (0);            /* No process-ID */
-#endif  
-
 /* The "process" (board) is already stopped awaiting our commands, and
    the program is already downloaded.  We just set its PC and go.  */
 
@@ -271,7 +280,8 @@ st2000_create_inferior (execfile, args, env)
   target_terminal_inferior ();
 
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
-  proceed ((CORE_ADDR)entry_pt, -1, 0);                /* Let 'er rip... */
+  /* Let 'er rip... */
+  proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /* Open a connection to a remote debugger.
@@ -358,8 +368,9 @@ st2000_detach (from_tty)
 /* Tell the remote machine to resume.  */
 
 static void
-st2000_resume (step, sig)
-     int step, sig;
+st2000_resume (pid, step, sig)
+     int pid, step;
+     enum target_signal sig;
 {
   if (step)
     {
@@ -380,17 +391,19 @@ st2000_resume (step, sig)
 
 static int
 st2000_wait (status)
-     WAITTYPE *status;
+     struct target_waitstatus *status;
 {
   int old_timeout = timeout;
 
-  WSETEXIT ((*status), 0);
+  status->kind = TARGET_WAITKIND_EXITED;
+  status->value.integer = 0;
 
   timeout = 0;         /* Don't time out -- user program is running. */
 
   expect_prompt(0);    /* Wait for prompt, outputting extraneous text */
 
-  WSETSTOP ((*status), SIGTRAP);
+  status->kind = TARGET_WAITKIND_STOPPED;
+  status->value.sig = TARGET_SIGNAL_TRAP;
 
   timeout = old_timeout;
 
@@ -809,6 +822,7 @@ the speed to connect at in bits per second.",
   st2000_mourn_inferior,
   0,                           /* can_run */
   0,                           /* notice_signals */
+  0,                           /* to_stop */
   process_stratum,
   0,                           /* next */
   1,
This page took 0.023957 seconds and 4 git commands to generate.