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/nto-procfs.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'gdb/nto-procfs.c') diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index bf869df..da0feae 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -701,17 +701,8 @@ nto_procfs_target::attach (const char *args, int from_tty) if (pid == getpid ()) error (_("Attaching GDB to itself is not a good idea...")); - if (from_tty) - { - const char *exec_file = get_exec_file (0); + target_announce_attach (from_tty, pid); - 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 ()); - } ptid_t ptid = do_attach (ptid_t (pid)); inf = current_inferior (); inferior_appeared (inf, pid); -- cgit v1.1