From: Tom Tromey Date: Wed, 18 Dec 2013 04:34:36 +0000 (-0700) Subject: Add target_ops argument to to_stop X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1eab8a48bf928ab7337833c785ec1316edbdbc8a;p=binutils-gdb.git Add target_ops argument to to_stop 2014-02-19 Tom Tromey * windows-nat.c (windows_stop): Add 'self' argument. * target.h (struct target_ops) : Add argument. * target.c (target_stop): Add argument. (debug_to_stop): Add argument. (update_current_target): Update. * remote.c (remote_stop): Add 'self' argument. * remote-sim.c (gdbsim_stop): Add 'self' argument. (gdbsim_cntrl_c): Update. * remote-m32r-sdi.c (m32r_stop): Add 'self' argument. * procfs.c (procfs_stop): Add 'self' argument. * nto-procfs.c (procfs_stop): Add 'self' argument. * monitor.c (monitor_stop): Add 'self' argument. (monitor_open): Update. * linux-nat.c (linux_nat_stop): Add argument. * inf-ptrace.c (inf_ptrace_stop): Add 'self' argument. * gnu-nat.c (gnu_stop): Add 'self' argument. * darwin-nat.c (darwin_stop): Add 'self' argument. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b84620feedc..82a81bc68fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2014-02-19 Tom Tromey + + * windows-nat.c (windows_stop): Add 'self' argument. + * target.h (struct target_ops) : Add argument. + * target.c (target_stop): Add argument. + (debug_to_stop): Add argument. + (update_current_target): Update. + * remote.c (remote_stop): Add 'self' argument. + * remote-sim.c (gdbsim_stop): Add 'self' argument. + (gdbsim_cntrl_c): Update. + * remote-m32r-sdi.c (m32r_stop): Add 'self' argument. + * procfs.c (procfs_stop): Add 'self' argument. + * nto-procfs.c (procfs_stop): Add 'self' argument. + * monitor.c (monitor_stop): Add 'self' argument. + (monitor_open): Update. + * linux-nat.c (linux_nat_stop): Add argument. + * inf-ptrace.c (inf_ptrace_stop): Add 'self' argument. + * gnu-nat.c (gnu_stop): Add 'self' argument. + * darwin-nat.c (darwin_stop): Add 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 47483bf5e9e..9027010557a 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -87,7 +87,7 @@ extern boolean_t exc_server (mach_msg_header_t *in, mach_msg_header_t *out); -static void darwin_stop (ptid_t); +static void darwin_stop (struct target_ops *self, ptid_t); static void darwin_resume_to (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signal); @@ -1144,7 +1144,7 @@ darwin_wait_to (struct target_ops *ops, } static void -darwin_stop (ptid_t t) +darwin_stop (struct target_ops *self, ptid_t t) { struct inferior *inf = current_inferior (); diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 88216a18a29..b2264981963 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2264,7 +2264,7 @@ gnu_terminal_init_inferior (struct target_ops *self) } static void -gnu_stop (ptid_t ptid) +gnu_stop (struct target_ops *self, ptid_t ptid) { error (_("to_stop target function not implemented")); } diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 048b1588d6c..bffb4bac031 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -321,7 +321,7 @@ inf_ptrace_kill (struct target_ops *ops) /* Stop the inferior. */ static void -inf_ptrace_stop (ptid_t ptid) +inf_ptrace_stop (struct target_ops *self, ptid_t ptid) { /* Send a SIGINT to the process group. This acts just like the user typed a ^C on the controlling terminal. Note that using a diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index dca4552656b..50eef3ad7a3 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4781,12 +4781,12 @@ linux_nat_stop_lwp (struct lwp_info *lwp, void *data) } static void -linux_nat_stop (ptid_t ptid) +linux_nat_stop (struct target_ops *self, ptid_t ptid) { if (non_stop) iterate_over_lwps (ptid, linux_nat_stop_lwp, NULL); else - linux_ops->to_stop (ptid); + linux_ops->to_stop (linux_ops, ptid); } static void diff --git a/gdb/monitor.c b/gdb/monitor.c index 6061a85e01d..06735dcf0aa 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -61,7 +61,7 @@ static struct target_ops *targ_ops; static void monitor_interrupt_query (void); static void monitor_interrupt_twice (int); -static void monitor_stop (ptid_t); +static void monitor_stop (struct target_ops *self, ptid_t); static void monitor_dump_regs (struct regcache *regcache); #if 0 @@ -783,7 +783,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) if (current_monitor->stop) { - monitor_stop (inferior_ptid); + monitor_stop (targ_ops, inferior_ptid); if ((current_monitor->flags & MO_NO_ECHO_ON_OPEN) == 0) { monitor_debug ("EXP Open echo\n"); @@ -2267,7 +2267,7 @@ monitor_load (struct target_ops *self, char *args, int from_tty) } static void -monitor_stop (ptid_t ptid) +monitor_stop (struct target_ops *self, ptid_t ptid) { monitor_debug ("MON stop\n"); if ((current_monitor->flags & MO_SEND_BREAK_ON_STOP) != 0) diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 5fedb9074ed..1b2b2ff6e62 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -1218,7 +1218,7 @@ procfs_create_inferior (struct target_ops *ops, char *exec_file, } static void -procfs_stop (ptid_t ptid) +procfs_stop (struct target_ops *self, ptid_t ptid) { devctl (ctl_fd, DCMD_PROC_STOP, NULL, 0, 0); } diff --git a/gdb/procfs.c b/gdb/procfs.c index bbe29f2422d..575984cce71 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -113,7 +113,7 @@ static void procfs_attach (struct target_ops *, char *, int); static void procfs_detach (struct target_ops *, const char *, int); static void procfs_resume (struct target_ops *, ptid_t, int, enum gdb_signal); -static void procfs_stop (ptid_t); +static void procfs_stop (struct target_ops *self, ptid_t); static void procfs_files_info (struct target_ops *); static void procfs_fetch_registers (struct target_ops *, struct regcache *, int); @@ -4265,7 +4265,7 @@ procfs_files_info (struct target_ops *ignore) kill(SIGINT) to the child's process group. */ static void -procfs_stop (ptid_t ptid) +procfs_stop (struct target_ops *self, ptid_t ptid) { kill (-inferior_process_group (), SIGINT); } diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 0af8cfc6418..02a812a769b 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1391,7 +1391,7 @@ m32r_load (struct target_ops *self, char *args, int from_tty) } static void -m32r_stop (ptid_t ptid) +m32r_stop (struct target_ops *self, ptid_t ptid) { if (remote_debug) fprintf_unfiltered (gdb_stdlog, "m32r_stop()\n"); diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 65da8f73b44..06146903020 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -88,7 +88,7 @@ static void gdbsim_files_info (struct target_ops *target); static void gdbsim_mourn_inferior (struct target_ops *target); -static void gdbsim_stop (ptid_t ptid); +static void gdbsim_stop (struct target_ops *self, ptid_t ptid); void simulator_command (char *args, int from_tty); @@ -919,7 +919,7 @@ gdbsim_stop_inferior (struct inferior *inf, void *arg) } static void -gdbsim_stop (ptid_t ptid) +gdbsim_stop (struct target_ops *self, ptid_t ptid) { struct sim_inferior_data *sim_data; @@ -963,7 +963,7 @@ gdb_os_poll_quit (host_callback *p) static void gdbsim_cntrl_c (int signo) { - gdbsim_stop (minus_one_ptid); + gdbsim_stop (NULL, minus_one_ptid); } static ptid_t diff --git a/gdb/remote.c b/gdb/remote.c index 002a9a2c0f2..35f4297ef2a 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -153,7 +153,7 @@ static void init_remote_ops (void); static void init_extended_remote_ops (void); -static void remote_stop (ptid_t); +static void remote_stop (struct target_ops *self, ptid_t); static int stubhex (int ch); @@ -5085,7 +5085,7 @@ remote_stop_as (ptid_t ptid) will eventually end up here. */ static void -remote_stop (ptid_t ptid) +remote_stop (struct target_ops *self, ptid_t ptid) { if (remote_debug) fprintf_unfiltered (gdb_stdlog, "remote_stop called\n"); diff --git a/gdb/target.c b/gdb/target.c index 03e4fe4e6e7..9b8e1e996bc 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -146,7 +146,7 @@ static void debug_to_load (struct target_ops *self, char *, int); static int debug_to_can_run (struct target_ops *self); -static void debug_to_stop (ptid_t); +static void debug_to_stop (struct target_ops *self, ptid_t); /* Pointer to array of target architecture structures; the size of the array; the current index into the array; the allocated size of the @@ -825,7 +825,7 @@ update_current_target (void) (char *(*) (struct target_ops *, struct thread_info *)) return_null); de_fault (to_stop, - (void (*) (ptid_t)) + (void (*) (struct target_ops *, ptid_t)) target_ignore); de_fault (to_rcmd, (void (*) (char *, struct ui_file *)) @@ -3925,7 +3925,7 @@ target_stop (ptid_t ptid) return; } - (*current_target.to_stop) (ptid); + (*current_target.to_stop) (¤t_target, ptid); } static void @@ -4987,9 +4987,9 @@ debug_to_thread_architecture (struct target_ops *ops, ptid_t ptid) } static void -debug_to_stop (ptid_t ptid) +debug_to_stop (struct target_ops *self, ptid_t ptid) { - debug_target.to_stop (ptid); + debug_target.to_stop (&debug_target, ptid); fprintf_unfiltered (gdb_stdlog, "target_stop (%s)\n", target_pid_to_str (ptid)); diff --git a/gdb/target.h b/gdb/target.h index d2258022a0d..3c2bf800183 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -524,7 +524,7 @@ struct target_ops char *(*to_pid_to_str) (struct target_ops *, ptid_t); char *(*to_extra_thread_info) (struct target_ops *, struct thread_info *); char *(*to_thread_name) (struct target_ops *, struct thread_info *); - void (*to_stop) (ptid_t); + void (*to_stop) (struct target_ops *, ptid_t); void (*to_rcmd) (char *command, struct ui_file *output); char *(*to_pid_to_exec_file) (int pid); void (*to_log_command) (const char *); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 9c1fdb0f31c..7514eb5a629 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -165,7 +165,7 @@ static int windows_initialization_done; #define DEBUG_MEM(x) if (debug_memory) printf_unfiltered x #define DEBUG_EXCEPT(x) if (debug_exceptions) printf_unfiltered x -static void windows_stop (ptid_t); +static void windows_stop (struct target_ops *self, ptid_t); static int windows_thread_alive (struct target_ops *, ptid_t); static void windows_kill_inferior (struct target_ops *); @@ -2403,7 +2403,7 @@ windows_mourn_inferior (struct target_ops *ops) ^C on the controlling terminal. */ static void -windows_stop (ptid_t ptid) +windows_stop (struct target_ops *self, ptid_t ptid) { DEBUG_EVENTS (("gdb: GenerateConsoleCtrlEvent (CTRLC_EVENT, 0)\n")); CHECK (GenerateConsoleCtrlEvent (CTRL_C_EVENT, current_event.dwProcessId));