checkpoint: print index of new checkpoint in response message
[deliverable/binutils-gdb.git] / gdb / linux-fork.c
index 835e6127833f982e9fd95dca549f19363297154d..d7eaeb1d86999498b613f099b1b4cd50882184af 100644 (file)
@@ -690,12 +690,15 @@ checkpoint_command (char *args, int from_tty)
 
   retpid = value_as_long (ret);
   get_last_target_status (&last_target_ptid, &last_target_waitstatus);
+
+  fp = find_fork_pid (retpid);
+
   if (from_tty)
     {
       int parent_pid;
 
-      printf_filtered (_("checkpoint: fork returned pid %ld.\n"),
-                      (long) retpid);
+      printf_filtered (_("checkpoint %d: fork returned pid %ld.\n"),
+                      fp != NULL ? fp->num : -1, (long) retpid);
       if (info_verbose)
        {
          parent_pid = ptid_get_lwp (last_target_ptid);
@@ -706,7 +709,6 @@ checkpoint_command (char *args, int from_tty)
        }
     }
 
-  fp = find_fork_pid (retpid);
   if (!fp)
     error (_("Failed to find new fork"));
   fork_save_infrun_state (fp, 1);
This page took 0.024015 seconds and 4 git commands to generate.