Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2] gdb/record-full: fix stop status when inferior isn't resumed
@ 2026-10-09 14:39 Guinevere Larsen
  2026-10-19 14:11 ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Guinevere Larsen @ 2026-10-09 14:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Guinevere Larsen

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


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

end of thread, other threads:[~2026-10-19 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 14:39 [PATCH v2] gdb/record-full: fix stop status when inferior isn't resumed Guinevere Larsen
2026-10-19 14:11 ` Andrew Burgess
2026-10-19 18:48   ` Guinevere Larsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox