/* Remote debugging interface for MIPS remote debugging protocol.
- Copyright 1993, 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Ian Lance Taylor
<ian@cygnus.com>.
#include "target.h"
#include "remote-utils.h"
#include "gdb_string.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
+#include "gdb_stat.h"
+#include "regcache.h"
#include <ctype.h>
-
-/* Microsoft C's stat.h doesn't define all the POSIX file modes. */
-#ifndef S_IROTH
-#define S_IROTH S_IREAD
-#endif
-
\f
/* Breakpoint types. Values 0, 1, and 2 must agree with the watch
static void mips_detach (char *args, int from_tty);
-static void mips_resume (int pid, int step, enum target_signal siggnal);
+static void mips_resume (ptid_t ptid, int step,
+ enum target_signal siggnal);
-static int mips_wait (int pid, struct target_waitstatus *status);
+static ptid_t mips_wait (ptid_t ptid,
+ struct target_waitstatus *status);
static int mips_map_regno (int regno);
if (cmd != '\0')
{
if (mips_need_reply)
- internal_error ("mips_request: Trying to send command before reply");
+ internal_error (__FILE__, __LINE__,
+ "mips_request: Trying to send command before reply");
sprintf (buff, "0x0 %c 0x%s 0x%s", cmd, paddr_nz (addr), paddr_nz (data));
mips_send_packet (buff, 1);
mips_need_reply = 1;
return 0;
if (!mips_need_reply)
- internal_error ("mips_request: Trying to get reply before command");
+ internal_error (__FILE__, __LINE__,
+ "mips_request: Trying to get reply before command");
mips_need_reply = 0;
where PMON does return a reply. */
static void
-mips_resume (int pid, int step, enum target_signal siggnal)
+mips_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
int err;
/* Wait until the remote stops, and return a wait status. */
-static int
-mips_wait (int pid, struct target_waitstatus *status)
+static ptid_t
+mips_wait (ptid_t ptid, struct target_waitstatus *status)
{
int rstatus;
int err;
{
status->kind = TARGET_WAITKIND_STOPPED;
status->value.sig = TARGET_SIGNAL_TRAP;
- return 0;
+ return inferior_ptid;
}
/* No timeout; we sit here as long as the program continues to execute. */
status->value.sig = mips_signal_from_protocol (rstatus & 0x7f);
}
- return 0;
+ return inferior_ptid;
}
/* We have to map between the register numbers used by gdb and the
init_wait_for_inferior ();
- /* FIXME: Should we set inferior_pid here? */
+ /* FIXME: Should we set inferior_ptid here? */
proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
flags = "f";
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
cmd = 'B';
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
- inferior_pid = 0; /* No process now */
+ inferior_ptid = null_ptid; /* No process now */
/* This is necessary because many things were based on the PC at the time that
we attached to the monitor, which is no longer valid now that we have loaded