checkpoint: print index of new checkpoint in response message
authorPatrick Palka <patrick@parcs.ath.cx>
Fri, 14 Nov 2014 19:04:50 +0000 (14:04 -0500)
committerJoel Brobecker <brobecker@adacore.com>
Sun, 23 Nov 2014 09:58:06 +0000 (13:58 +0400)
This way the user can know the index of the latest checkpoint without
having to run "info checkpoints" afterwards.

gdb/ChangeLog:

* linux-fork.c (checkpoint_command): Print index of new
checkpoint in response message.

gdb/ChangeLog
gdb/linux-fork.c

index 2adf23bfa901896461a2a27d8678e85dae555d6e..e16f28ff60b78ba853631c09fd4d9e42ab7e6903 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-23  Patrick Palka  <patrick@parcs.ath.cx>
+
+       Pushed by Joel Brobecker  <brobecker@adacore.com>
+       * linux-fork.c (checkpoint_command): Print index of new
+       checkpoint in response message.
+
 2014-11-23  Yao Qi  <yao@codesourcery.com>
 
        * valprint.c (read_string): Move local variables 'found_nul',
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);