Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Guinevere Larsen <guinevere@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/record: fix missing "no history" message in some situations
Date: Tue, 8 Sep 2026 11:18:11 -0400	[thread overview]
Message-ID: <1ea00472-ee53-402f-b8a1-a51a49f5f9a6@simark.ca> (raw)
In-Reply-To: <20260908131400.28513-1-guinevere@redhat.com>

On 9/8/26 9:14 AM, Guinevere Larsen wrote:
> I recently noticed that the end of recoded history message wasn't

recoded -> recorded

> shown when replaying an inferior until end end for the first time, it

"until end end"?

> was only shown when trying to reverse past the start of
> history. Executing forward past the end will not warn the user that
> recording is going to start again, it just does so.
> 
> This was happening because the out-of-history was only set when it
> caused the execution loop to stop, so using "next" to reach the end of
> history, for example, wouldn't trigger it as I expected.  This commit
> fixes that to make out-of-history check only happen after the loop is
> finished.

Can you give examples of "before" and "after" GDB sessions so that it's
more obvious what the change is?

Could this use a test?

> ---
>  gdb/record-full.c | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/gdb/record-full.c b/gdb/record-full.c
> index 26bd85d34f6..c02bc39f12c 100644
> --- a/gdb/record-full.c
> +++ b/gdb/record-full.c
> @@ -1362,19 +1362,11 @@ record_full_wait_1 (struct target_ops *ops,
>  	      /* Check for beginning and end of log.  */
>  	      if (execution_direction == EXEC_REVERSE
>  		  && record_full_next_insn < 0)
> -		{
> -		  /* Hit beginning of record log in reverse.  */
> -		  status->set_no_history ();
> -		  record_full_next_insn = 0;
>  		  break;
> -		}
> -	      if (execution_direction != EXEC_REVERSE
> +
> +	      else if (execution_direction != EXEC_REVERSE
>  		  && record_full_next_insn == record_full_log.size ())

The indentation of this && line needs to be adjusted.

> -		{
> -		  /* Hit end of record log going forward.  */
> -		  status->set_no_history ();
>  		  break;
> -		}

The indentation of those "break" is wrong, you could fix it while at it.

Simon

  reply	other threads:[~2026-09-08 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 13:14 Guinevere Larsen
2026-09-08 15:18 ` Simon Marchi [this message]
2026-09-08 20:55   ` Guinevere Larsen

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=1ea00472-ee53-402f-b8a1-a51a49f5f9a6@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.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