From bc521517b7058a231a08bf8f3deae7cd41cd62d7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 26 Dec 2021 21:49:48 -0700 Subject: Introduce target_announce_attach This introduces target_announce_attach, by analog with target_announce_detach. Then it converts existing targets to use this, rather than emitting their own output by hand. --- gdb/darwin-nat.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'gdb/darwin-nat.c') diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 98720b330aa..e9c24dcc5dc 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -2002,17 +2002,7 @@ darwin_nat_target::attach (const char *args, int from_tty) if (pid == getpid ()) /* Trying to masturbate? */ error (_("I refuse to debug myself!")); - if (from_tty) - { - const char *exec_file = get_exec_file (0); - - if (exec_file) - printf_unfiltered (_("Attaching to program: %s, %s\n"), exec_file, - target_pid_to_str (ptid_t (pid)).c_str ()); - else - printf_unfiltered (_("Attaching to %s\n"), - target_pid_to_str (ptid_t (pid)).c_str ()); - } + target_announce_attach (from_tty, pid); if (pid == 0 || ::kill (pid, 0) < 0) error (_("Can't attach to process %d: %s (%d)"), -- cgit v1.2.1