From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb, testsuite: fix gdb.multi/remove-inferiors.exp for remote targets
Date: Thu, 16 Apr 2026 18:23:03 +0200 [thread overview]
Message-ID: <20260416162303.2764834-1-tankut.baris.aktemur@intel.com> (raw)
When running gdb.multi/remove-inferiors.exp with the native-gdbserver
board file, we see
WARNING: Timed out waiting for EOF in server after monitor exit
Fix this by switching back to inferior 2 at the end of the test.
When running with native-extended-gdbserver, we see
FAIL: gdb.multi/remove-inferiors.exp: runto: run to main
Fix this by setting remote exec-file before running to main.
After this patch, we see
# of expected passes 10
for all three of default, native-gdbserver, native-extended-gdbserver
board files.
---
gdb/testsuite/gdb.multi/remove-inferiors.exp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.multi/remove-inferiors.exp b/gdb/testsuite/gdb.multi/remove-inferiors.exp
index c991ea59193..75402e26974 100644
--- a/gdb/testsuite/gdb.multi/remove-inferiors.exp
+++ b/gdb/testsuite/gdb.multi/remove-inferiors.exp
@@ -21,7 +21,7 @@ if { [build_executable ${testfile}.exp ${binfile} "${srcfile}" {debug}] != 0 } {
proc switch_to_inferior { num message } {
gdb_test "inferior ${num}" \
- "\\\[Switching to inferior ${num} \\\[<null>\\\] \\\(<noexec>\\\)\\\]" \
+ "\\\[Switching to inferior ${num} .*" \
"${message}"
}
@@ -52,6 +52,8 @@ proc test_remove_inferiors { } {
[multi_line "Reading symbols from ${binfile_re}\.\.\.(" \
"Expanding full symbols from ${binfile_re}\.\.\.)?" ] \
"load binary"
+ gdb_test_no_output "set remote exec-file ${binfile}" \
+ "set remote exec-file"
if {![runto_main]} {
return
@@ -65,6 +67,10 @@ proc test_remove_inferiors { } {
gdb_test "remove-inferiors 2" \
"warning: Can not remove active inferior 2." \
"can't remove active inferior"
+
+ # Back to inferior 2 for the target to be exited properly, in case
+ # it is remote.
+ switch_to_inferior 2 "back to second inferior"
}
test_remove_inferiors
--
2.34.1
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
reply other threads:[~2026-04-16 16:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260416162303.2764834-1-tankut.baris.aktemur@intel.com \
--to=tankut.baris.aktemur@intel.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