From: Guinevere Larsen <guinevere@redhat.com>
To: gdb-patches@sourceware.org
Cc: Guinevere Larsen <guinevere@redhat.com>
Subject: [PATCH v2] gdb/record-full: fix stop status when inferior isn't resumed
Date: Fri, 9 Oct 2026 11:39:16 -0300 [thread overview]
Message-ID: <20261009143916.47983-1-guinevere@redhat.com> (raw)
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
until all threads have a wait status of "no_resumed", and the "ignore"
status would make us iterate over them and wait more.
This commit fixes that by setting the status correctly to
not_resumed. The commit does not include a test because almost nothing
works with multi-threaded programs, and my upcoming series will
exercise this code path plenty of times, when testing it makes more
sense.
---
gdb/record-full.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 26bd85d34f6..45b7b4b39d1 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -1063,7 +1063,7 @@ static int record_full_resume_step = 0;
/* 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. */
+ TARGET_WAITKIND_NO_RESUMED. */
static int record_full_resumed = 0;
/* The execution direction of the last resume we got. This is
@@ -1187,8 +1187,8 @@ record_full_wait_1 (struct target_ops *ops,
{
gdb_assert ((options & TARGET_WNOHANG) != 0);
- /* No interesting event. */
- status->set_ignore ();
+ /* No thread was reusmed at all. */
+ status->set_no_resumed ();
return minus_one_ptid;
}
base-commit: d2c5672687e46b23a9dcb6f88c878cb2df06819a
--
2.55.0
next reply other threads:[~2026-10-09 14:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 14:39 Guinevere Larsen [this message]
2026-10-19 14:11 ` Andrew Burgess
2026-10-19 18:48 ` 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=20261009143916.47983-1-guinevere@redhat.com \
--to=guinevere@redhat.com \
--cc=gdb-patches@sourceware.org \
/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