public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Markus Metzger <markus.t.metzger@intel.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/4] gdb, infrun, record: move no-history notification into normal_stop
Date: Wed, 3 Nov 2021 14:58:25 +0000	[thread overview]
Message-ID: <5707c681-268b-46a4-f17f-feb0f86455a0@palves.net> (raw)
In-Reply-To: <20210316093501.936148-4-markus.t.metzger@intel.com>

Hi Markus,

On 2021-03-16 09:35, Markus Metzger via Gdb-patches wrote:
> Leave calling gdb::observers::no_history.notify to normal_stop based on
> the last waitstatus.
> 
> gdb/ChangeLog:
> 2021-01-15  Markus Metzger  <markus.t.metzger@intel.com>
> 
> 	* infrun.c (handle_inferior_event): Remove no-history notification.
> 	(keep_going_pass_signal): Likewise.  Set last waitstatus.
> 	(normal_stop): Notify no-history observers.
> ---
>  gdb/infrun.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/infrun.c b/gdb/infrun.c
> index e79094ad2b2..81e31cf0019 100644
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -5544,8 +5544,6 @@ handle_inferior_event (struct execution_control_state *ecs)
>        if (handle_stop_requested (ecs))
>  	return;
>  
> -      gdb::observers::no_history.notify ();
> -
>        /* Cancel an in-flight step-over.  It will not succeed since we
>  	 won't be able to step at the end of the execution history.  */
>        finish_step_over (ecs);
> @@ -7835,7 +7833,8 @@ keep_going_pass_signal (struct execution_control_state *ecs)
>    if (ecs->event_thread->control.is_replaying
>        && !target_record_is_replaying (ecs->event_thread->ptid))
>      {
> -      gdb::observers::no_history.notify ();
> +      ecs->ws.kind = TARGET_WAITKIND_NO_HISTORY;
> +      target_last_waitstatus = ecs->ws;

Ah, you have this here.  This bit about setting the last waitstatus should
be in patch #1, and as mentioned in my review there, use set_last_target_status.

Otherwise this LGTM.

Thanks,
Pedro Alves

>        stop_waiting (ecs);
>        normal_stop ();
>        return;
> @@ -8463,6 +8462,9 @@ normal_stop (void)
>  	return 1;
>      }
>  
> +  if (last.kind == TARGET_WAITKIND_NO_HISTORY)
> +    gdb::observers::no_history.notify ();
> +
>    /* Notify observers about the stop.  This is where the interpreters
>       print the stop event.  */
>    if (inferior_ptid != null_ptid)
> 


  reply	other threads:[~2021-11-03 14:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  9:34 [PATCH 0/4] gdb, btrace: infrun fixes Markus Metzger
2021-03-16  9:34 ` [PATCH 1/4] gdb, infrun, btrace: fix reverse/replay stepping at end of execution history Markus Metzger
2021-11-03 13:11   ` Pedro Alves
2021-11-22 17:23     ` Metzger, Markus T
2021-03-16  9:34 ` [PATCH 2/4] gdb, infrun, record: fix hang when step-over fails with no-history Markus Metzger
2021-11-03 14:51   ` Pedro Alves
2021-11-22 17:23     ` Metzger, Markus T
2021-03-16  9:35 ` [PATCH 3/4] gdb, infrun, record: move no-history notification into normal_stop Markus Metzger
2021-11-03 14:58   ` Pedro Alves [this message]
2021-03-16  9:35 ` [PATCH 4/4] gdb, infrun: fix multi-threaded reverse stepping Markus Metzger
2021-11-03 18:43   ` Pedro Alves
2021-11-22 17:23     ` Metzger, Markus T
2021-04-13 11:43 ` [PATCH 0/4] gdb, btrace: infrun fixes Metzger, Markus T
2021-05-26  2:49 ` Simon Marchi
2021-06-08  9:05   ` Metzger, Markus T
2021-07-28  6:41     ` Metzger, Markus T
2021-09-21  9:45       ` Metzger, Markus T
2021-11-03 18:52 ` Pedro Alves
2021-11-23 11:33   ` Metzger, Markus T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5707c681-268b-46a4-f17f-feb0f86455a0@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).