aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-01-31 13:45:06 +0000
committerPedro Alves <palves@redhat.com>2018-01-31 13:45:06 +0000
commitf6cfb42730ed37bfb32cb27ef627df930f437f08 (patch)
treebbe22d2f3cfc32677da08f81ae60731190b7cc1e /gdb/remote-sim.c
parentbf3077a6c3c9ff21c072a6f42c91bffefd35bc15 (diff)
downloadgdb-f6cfb42730ed37bfb32cb27ef627df930f437f08.zip
gdb-f6cfb42730ed37bfb32cb27ef627df930f437f08.tar.gz
gdb-f6cfb42730ed37bfb32cb27ef627df930f437f08.tar.bz2
gdb: Fix remote-sim/MinGW/Darwin builds
The recent commit e671cd59 ("Per-inferior target_terminal state, fix PR gdb/13211, more") missed adjusting a few targets to the new target_ops->to_interrupt interface, breaking the build for those targets. This fixes it. Note: remote-sim doesn't really support async execution, so I don't think gdbsim_interrupt is ever reached via target_interrupt. (It is reached via gdbsim_cntrl_c though). The inflow.c changes are a bit ugly, but they're just doing what other parts of the file already do to handle the same missing functions. Targets that don't have 'kill', like mingw have their own target_ops->to_interrupt implementation, so it's fine to make child_interrupt be a nop. gdb/ChangeLog: 2018-01-31 Pedro Alves <palves@redhat.com> * darwin-nat.c (darwin_interrupt): Remove ptid_t parameter. * inflow.c (child_terminal_save_inferior): Wrap reference to tcgetpgrp in HAVE_TERMIOS_H. (child_interrupt, child_pass_ctrlc): Wrap references to signal in _WIN32. * remote-sim.c (gdbsim_interrupt): Remove ptid_t parameter and always iterate over all inferiors. (gdbsim_cntrl_c): Adjust. * windows-nat.c (windows_interrupt): Remove 'ptid_t' parameter.
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index aed7a34..2f8fb68 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -86,7 +86,7 @@ static void gdbsim_files_info (struct target_ops *target);
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);
@@ -920,24 +920,9 @@ gdbsim_interrupt_inferior (struct inferior *inf, void *arg)
}
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.
@@ -961,7 +946,7 @@ gdb_os_poll_quit (host_callback *p)
static void
gdbsim_cntrl_c (int signo)
{
- gdbsim_interrupt (NULL, minus_one_ptid);
+ gdbsim_interrupt (NULL);
}
static ptid_t