From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] [gdb/testsuite] Use gdb_exit_cleanup a bit more
Date: Sat, 19 Sep 2026 10:42:36 +0200 [thread overview]
Message-ID: <20260919084237.1045724-3-tdevries@suse.de> (raw)
In-Reply-To: <20260919084237.1045724-1-tdevries@suse.de>
I ran into trouble running test-case gdb.base/quit-live.exp using a remote
host configuration:
- host board local-remote-host
- target board remote-gdbserver-on-localhost.
The problem is that the test-case makes gdb quit without updating
gdb_spawn_id. Consequently, default_gdb_exit tries to exit gdb.
It does so by sending quit to gdb and waiting for it to exit, which get us:
...
ERROR: : spawn id exp9 not open
...
Fix this using gdb_exit_cleanup. Likewise in gdb.threads/killed.exp.
---
gdb/testsuite/gdb.base/quit-live.exp | 1 +
gdb/testsuite/gdb.threads/killed.exp | 1 +
2 files changed, 2 insertions(+)
diff --git a/gdb/testsuite/gdb.base/quit-live.exp b/gdb/testsuite/gdb.base/quit-live.exp
index 14f87f9b7f8..8dae4fe2aca 100644
--- a/gdb/testsuite/gdb.base/quit-live.exp
+++ b/gdb/testsuite/gdb.base/quit-live.exp
@@ -152,6 +152,7 @@ proc quit_with_live_inferior {appear_how extra_inferior quit_how} {
gdb_test_multiple "" $test {
eof {
pass $test
+ gdb_exit_cleanup
}
}
}
diff --git a/gdb/testsuite/gdb.threads/killed.exp b/gdb/testsuite/gdb.threads/killed.exp
index 39b60dff8dd..a52ae552a2c 100644
--- a/gdb/testsuite/gdb.threads/killed.exp
+++ b/gdb/testsuite/gdb.threads/killed.exp
@@ -76,6 +76,7 @@ gdb_expect {
}
eof {
pass "GDB exits after multi-threaded program exits messily"
+ gdb_exit_cleanup
}
-re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" {
kfail "gdb/568" "GDB exits after multi-threaded program exits messily"
--
2.51.0
next prev parent reply other threads:[~2026-09-19 8:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 8:42 [PATCH 0/3] [gdb/testsuite] Fix gdb.base/quit-live.exp for remote host Tom de Vries
2026-09-19 8:42 ` [PATCH 1/3] [gdb/testsuite] Add gdb_exit_cleanup Tom de Vries
2026-09-27 8:52 ` Andrew Burgess
2026-09-19 8:42 ` Tom de Vries [this message]
2026-09-27 8:52 ` [PATCH 2/3] [gdb/testsuite] Use gdb_exit_cleanup a bit more Andrew Burgess
2026-09-28 8:59 ` Tom de Vries
2026-09-19 8:42 ` [PATCH 3/3] [gdb/testsuite] Fix gdb.base/quit-live.exp for remote host Tom de Vries
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=20260919084237.1045724-3-tdevries@suse.de \
--to=tdevries@suse.de \
--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