Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb, testsuite: fix gdb.multi/remove-inferiors.exp for remote targets
@ 2026-04-16 16:23 Tankut Baris Aktemur
  0 siblings, 0 replies; only message in thread
From: Tankut Baris Aktemur @ 2026-04-16 16:23 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-16 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-16 16:23 [PATCH] gdb, testsuite: fix gdb.multi/remove-inferiors.exp for remote targets Tankut Baris Aktemur

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