From 41e321a8973edf99f69eb3f11cc076a69be726af Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 26 Dec 2021 22:03:09 -0700 Subject: 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. --- gdb/windows-nat.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gdb/windows-nat.c') diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index c85f7c0..bdf6ac9 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1962,14 +1962,8 @@ windows_nat_target::detach (inferior *inf, int from_tty) } DebugSetProcessKillOnExit (FALSE); - if (detached && from_tty) - { - const char *exec_file = get_exec_file (0); - if (exec_file == 0) - exec_file = ""; - printf_unfiltered ("Detaching from program: %s, Pid %u\n", exec_file, - (unsigned) current_event.dwProcessId); - } + if (detached) + target_announce_detach (from_tty); x86_cleanup_dregs (); switch_to_no_thread (); -- cgit v1.1