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 was derived from remote-eb.c, which did a similar job, but for
an AMD-29K running EBMON. That file was in turn derived from remote.c
#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 "gdb_string.h"
#include <sys/types.h>
#include "serial.h"
/* 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));
}
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. */
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.
/* 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)
{
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;
st2000_mourn_inferior,
0, /* can_run */
0, /* notice_signals */
+ 0, /* to_stop */
process_stratum,
0, /* next */
1,