static void gdbsim_close (struct target_ops *self);
-static void gdbsim_detach (struct target_ops *ops, const char *args,
- int from_tty);
+static void gdbsim_detach (struct target_ops *ops, inferior *inf, int from_tty);
static void gdbsim_prepare_to_store (struct target_ops *self,
struct regcache *regcache);
static void gdbsim_mourn_inferior (struct target_ops *target);
-static void gdbsim_interrupt (struct target_ops *self, ptid_t ptid);
+static void gdbsim_interrupt (struct target_ops *self);
void simulator_command (char *args, int from_tty);
/* GDB version of printf_filtered callback. */
-static void
-gdb_os_printf_filtered (host_callback * p, const char *format,...)
+static void ATTRIBUTE_PRINTF (2, 3)
+gdb_os_printf_filtered (host_callback * p, const char *format, ...)
{
va_list args;
/* GDB version of error vprintf_filtered. */
-static void
+static void ATTRIBUTE_PRINTF (2, 0)
gdb_os_vprintf_filtered (host_callback * p, const char *format, va_list ap)
{
vfprintf_filtered (gdb_stdout, format, ap);
/* GDB version of error evprintf_filtered. */
-static void
+static void ATTRIBUTE_PRINTF (2, 0)
gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap)
{
vfprintf_filtered (gdb_stderr, format, ap);
/* GDB version of error callback. */
-static void
+static void ATTRIBUTE_PRINTF (2, 3)
gdb_os_error (host_callback * p, const char *format, ...)
{
va_list args;
/* Takes a program previously attached to and detaches it.
The program may resume execution (some targets do, some don't) and will
no longer stop on signals, etc. We better not have left any breakpoints
- in the program or it'll die when it hits one. ARGS is arguments
- typed by the user (e.g. a signal to send the process). FROM_TTY
- says whether to be verbose or not. */
+ in the program or it'll die when it hits one. FROM_TTY says whether to be
+ verbose or not. */
/* Terminate the open connection to the remote debugger.
Use this when you want to detach and do something else with your gdb. */
static void
-gdbsim_detach (struct target_ops *ops, const char *args, int from_tty)
+gdbsim_detach (struct target_ops *ops, inferior *inf, int from_tty)
{
if (remote_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbsim_detach: args \"%s\"\n", args);
+ fprintf_unfiltered (gdb_stdlog, "gdbsim_detach\n");
unpush_target (ops); /* calls gdbsim_close to do the real work */
if (from_tty)
}
static void
-gdbsim_interrupt (struct target_ops *self, ptid_t ptid)
+gdbsim_interrupt (struct target_ops *self)
{
- struct sim_inferior_data *sim_data;
-
- if (ptid_equal (ptid, minus_one_ptid))
- {
- iterate_over_inferiors (gdbsim_interrupt_inferior, NULL);
- }
- else
- {
- struct inferior *inf = find_inferior_ptid (ptid);
-
- if (inf == NULL)
- error (_("Can't stop pid %d. No inferior found."),
- ptid_get_pid (ptid));
-
- gdbsim_interrupt_inferior (inf, NULL);
- }
+ iterate_over_inferiors (gdbsim_interrupt_inferior, NULL);
}
/* GDB version of os_poll_quit callback.
static void
gdbsim_cntrl_c (int signo)
{
- gdbsim_interrupt (NULL, minus_one_ptid);
+ gdbsim_interrupt (NULL);
}
static ptid_t