mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
Factor out "Detaching from program" message printing
Several targets have a copy of the same code that prints "Detaching from program ..." in their target_detach implementation. Factor that out to a common function. (For now, I left the couple targets that print this a bit differently alone. Maybe this could be further pulled out into infcmd.c. If we did that, and those targets want to continue printing differently, this new function could be converted to a target method.) gdb/ChangeLog: 2016-07-01 Pedro Alves <palves@redhat.com> * darwin-nat.c (darwin_detach): Use target_announce_detach. * inf-ptrace.c (inf_ptrace_detach): Likewise. * nto-procfs.c (procfs_detach): Likewise. * remote.c (remote_detach_1): Likewise. * target.c (target_announce_detach): New function. * target.h (target_announce_detach): New declaration.
This commit is contained in:
@ -1302,6 +1302,11 @@ extern struct target_ops *find_run_target (void);
|
||||
#define target_post_attach(pid) \
|
||||
(*current_target.to_post_attach) (¤t_target, pid)
|
||||
|
||||
/* Display a message indicating we're about to detach from the current
|
||||
inferior process. */
|
||||
|
||||
extern void target_announce_detach (int from_tty);
|
||||
|
||||
/* 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
|
||||
|
Reference in New Issue
Block a user