public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] checkpoint: print index of new checkpoint in response message
@ 2014-11-14 19:05 Patrick Palka
  2014-11-22 20:55 ` Patrick Palka
  2014-11-23  9:46 ` Joel Brobecker
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Palka @ 2014-11-14 19:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: Patrick Palka

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] checkpoint: print index of new checkpoint in response message
  2014-11-14 19:05 [PATCH] checkpoint: print index of new checkpoint in response message Patrick Palka
@ 2014-11-22 20:55 ` Patrick Palka
  2014-11-23  9:46 ` Joel Brobecker
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick Palka @ 2014-11-22 20:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Patrick Palka

On Fri, Nov 14, 2014 at 2:04 PM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> 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
>

Ping.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] checkpoint: print index of new checkpoint in response message
  2014-11-14 19:05 [PATCH] checkpoint: print index of new checkpoint in response message Patrick Palka
  2014-11-22 20:55 ` Patrick Palka
@ 2014-11-23  9:46 ` Joel Brobecker
  2014-11-23 12:46   ` Patrick Palka
  1 sibling, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2014-11-23  9:46 UTC (permalink / raw)
  To: Patrick Palka; +Cc: gdb-patches

> 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.

Looks good.

I will push this patch for you, but perhaps it might be time
for you to request "Write After Approval" privileges, allow you
to push your patches yourself. Let me know if you'd like to get
set up for that.

Thank you,
-- 
Joel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] checkpoint: print index of new checkpoint in response message
  2014-11-23  9:46 ` Joel Brobecker
@ 2014-11-23 12:46   ` Patrick Palka
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick Palka @ 2014-11-23 12:46 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Sun, Nov 23, 2014 at 4:46 AM, Joel Brobecker <brobecker@adacore.com> wrote:
>> 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.
>
> Looks good.
>
> I will push this patch for you, but perhaps it might be time
> for you to request "Write After Approval" privileges, allow you
> to push your patches yourself. Let me know if you'd like to get
> set up for that.

Thanks for committing these patches for me.  I am interested in
write-after-approval privileges.  I will email you privately.

>
> Thank you,
> --
> Joel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-23 12:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 19:05 [PATCH] checkpoint: print index of new checkpoint in response message Patrick Palka
2014-11-22 20:55 ` Patrick Palka
2014-11-23  9:46 ` Joel Brobecker
2014-11-23 12:46   ` Patrick Palka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).