diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-26 22:03:09 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-01-06 08:56:20 -0700 |
commit | 41e321a8973edf99f69eb3f11cc076a69be726af (patch) | |
tree | 449b72055dc8ecd8394d052cfda9a1947240272b /gdb/procfs.c | |
parent | bc521517b7058a231a08bf8f3deae7cd41cd62d7 (diff) | |
download | binutils-41e321a8973edf99f69eb3f11cc076a69be726af.zip binutils-41e321a8973edf99f69eb3f11cc076a69be726af.tar.gz binutils-41e321a8973edf99f69eb3f11cc076a69be726af.tar.bz2 |
Use target_announce_detach in more targets
target_announce_detach was added in commit 0f48b757 ("Factor out
"Detaching from program" message printing"). There, Pedro wrote:
(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.)
It seems to me that the differences aren't very big, and in some cases
other targets handled the output a bit more nicely. In particular,
some targets will print a different message when exec_file==NULL,
rather than printing the same output with an empty string as
exec_file.
This patch incorporates the nicer output into target_announce_detach,
then changes the remaining ports to use this function.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index ddc8623..840201d 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -1786,19 +1786,7 @@ procfs_target::attach (const char *args, int from_tty) void procfs_target::detach (inferior *inf, int from_tty) { - int pid = inferior_ptid.pid (); - - if (from_tty) - { - const char *exec_file; - - exec_file = get_exec_file (0); - if (exec_file == NULL) - exec_file = ""; - - printf_filtered (_("Detaching from program: %s, %s\n"), exec_file, - target_pid_to_str (ptid_t (pid)).c_str ()); - } + target_announce_detach (from_tty); do_detach (); |