aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-fork.c
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2014-11-14 14:04:50 -0500
committerJoel Brobecker <brobecker@adacore.com>2014-11-23 13:58:06 +0400
commit6f9d33d89858fce0278af93658fcaef8d76f33cb (patch)
treeb05b234b99a72ac405a2e6ed2d7a693e399eacc9 /gdb/linux-fork.c
parent88db67effd5c083011397a00e40fe03ea70629d8 (diff)
downloadgdb-6f9d33d89858fce0278af93658fcaef8d76f33cb.zip
gdb-6f9d33d89858fce0278af93658fcaef8d76f33cb.tar.gz
gdb-6f9d33d89858fce0278af93658fcaef8d76f33cb.tar.bz2
checkpoint: print index of new checkpoint in response message
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.
Diffstat (limited to 'gdb/linux-fork.c')
-rw-r--r--gdb/linux-fork.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 835e612..d7eaeb1 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -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);