From: Andrew Burgess <aburgess@redhat.com>
To: Guinevere Larsen <guinevere@redhat.com>, gdb-patches@sourceware.org
Cc: Guinevere Larsen <guinevere@redhat.com>
Subject: Re: [PATCH] gdb/record-full: fix stop status when inferior isn't resumed
Date: Fri, 09 Oct 2026 11:44:48 +0100 [thread overview]
Message-ID: <87mrsntaov.fsf@redhat.com> (raw)
In-Reply-To: <20261007204014.893637-1-guinevere@redhat.com>
Guinevere Larsen <guinevere@redhat.com> writes:
> The wait function for the record-full target has a check for whether
> or not the inferior should be resumed. However, when we correctly
> identified that it shouldn't be resumed, we incorrectly set the exit
> status as "ignore", as though the inferior had resumed and had an
> uninteresting stop.
>
> This would cause a problem when - for example - GDB has to wait for
> all threads to actually be stopped, because we do that by waiting all
Missing word: "...we do that by waiting UNTIL all threads..."
> threads have a wait status of "no_resumed", and the "ignore" status
> would make us iterate over them and wait more.
Your excellent "this would cause a problem when ..." description makes
me ask why there's no test included with this patch. I know that
multi-threaded recording is not working well (or at all?) in upstream
GDB, so maybe it's just not possible to test this right now. If this is
the case then it might be worth a sentence to explain this in the commit
message.
>
> This commit fixes that by setting the status correctly to not_resumed.
There is a global variable `record_full_resumed` which is documented
like this:
/* True if we've been resumed, and so each record_full_wait call should
advance execution. If this is false, record_full_wait will return a
TARGET_WAITKIND_IGNORE. */
static int record_full_resumed = 0;
With this change I think that this comment now needs to be updated.
> ---
> gdb/record-full.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/record-full.c b/gdb/record-full.c
> index 26bd85d34f6..f56b3dfc7fd 100644
> --- a/gdb/record-full.c
> +++ b/gdb/record-full.c
> @@ -1188,7 +1188,7 @@ record_full_wait_1 (struct target_ops *ops,
> gdb_assert ((options & TARGET_WNOHANG) != 0);
>
> /* No interesting event. */
> - status->set_ignore ();
> + status->set_no_resumed ();
I think the comment "No interesting event" could be improved, maybe "No
resumed threads" or something similar?
Thanks,
Andrew
next prev parent reply other threads:[~2026-10-09 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 20:40 Guinevere Larsen
2026-10-09 10:44 ` Andrew Burgess [this message]
2026-10-09 14:32 ` 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=87mrsntaov.fsf@redhat.com \
--to=aburgess@redhat.com \
--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