Factor out "Detaching from program" message printing
[deliverable/binutils-gdb.git] / gdb / target.c
index bb86adf9b702313f999379198c9096adc967218f..d3fc35ba14571eccc0b8fb1d31d12a1db69f1e22 100644 (file)
@@ -3251,6 +3251,28 @@ find_target_at (enum strata stratum)
 }
 
 \f
+
+/* See target.h  */
+
+void
+target_announce_detach (int from_tty)
+{
+  pid_t pid;
+  char *exec_file;
+
+  if (!from_tty)
+    return;
+
+  exec_file = get_exec_file (0);
+  if (exec_file == NULL)
+    exec_file = "";
+
+  pid = ptid_get_pid (inferior_ptid);
+  printf_unfiltered (_("Detaching from program: %s, %s\n"), exec_file,
+                    target_pid_to_str (pid_to_ptid (pid)));
+  gdb_flush (gdb_stdout);
+}
+
 /* The inferior process has died.  Long live the inferior!  */
 
 void
This page took 0.025281 seconds and 4 git commands to generate.