This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] checkpoint: print index of new checkpoint in response message
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: gdb-patches at sourceware dot org
- Cc: Patrick Palka <patrick at parcs dot ath dot cx>
- Date: Fri, 14 Nov 2014 14:04:50 -0500
- Subject: [PATCH] checkpoint: print index of new checkpoint in response message
- Authentication-results: sourceware.org; auth=none
This way the user can know the index of the latest checkpoint without
having to run "info checkpoints" afterwards.
2014-11-14 Patrick Palka <patrick@parcs.ath.cx>
* linux-fork.c (checkpoint_command): Print index of new
checkpoint in response message.
---
gdb/linux-fork.c | 8 +++++---
1 file 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);
--
2.2.0.rc1.23.gf570943