Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: set up the new inferior in remove-inferiors.exp
@ 2026-11-08 18:59 Josip Seketa
  2026-11-23 16:05 ` Rohr, Stephan
  0 siblings, 1 reply; 4+ messages in thread
From: Josip Seketa @ 2026-11-08 18:59 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom de Vries

With the native-extended-gdbserver board, remove-inferiors.exp fails:

  (gdb) run
  Starting program: .../remove-inferiors
  Running the default executable on the remote target failed; try "set remote exec-file"?
  FAIL: gdb.multi/remove-inferiors.exp: runto: run to main

"set remote exec-file" is per inferior.  The board sets it for
inferior 1, but the test removes inferior 1 and runs the program in
inferior 2, where it loads the binary with a plain "file", so the
remote side has nothing to run.

Load the binary with gdb_load instead, so that the board sets the
inferior up.
---
Tested on x86_64 GNU/Linux: native-extended-gdbserver 5 PASS 1 FAIL ->
7 PASS, also with "maint set target-non-stop on"; native-gdbserver and
unix 8 PASS -> 7 PASS (the "load binary" test is gone).

I have no FSF copyright assignment.  This is my own work, not my
employer's.

 gdb/testsuite/gdb.multi/remove-inferiors.exp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.multi/remove-inferiors.exp b/gdb/testsuite/gdb.multi/remove-inferiors.exp
index ae2ecdffb83..2514ec392d8 100644
--- a/gdb/testsuite/gdb.multi/remove-inferiors.exp
+++ b/gdb/testsuite/gdb.multi/remove-inferiors.exp
@@ -46,12 +46,12 @@ proc test_remove_inferiors { } {
     # Test that it is possible to remove a non-active non-current inferior.
     gdb_test_no_output "remove-inferiors 1" "remove non-current inferior"
 
-    # Load binfile and start the inferior.
-    set binfile_re [string_to_regexp ${binfile}]
-    gdb_test "file ${binfile}" \
-	[multi_line "Reading symbols from ${binfile_re}\.\.\.(" \
-	     "Expanding full symbols from ${binfile_re}\.\.\.)?" ] \
-	"load binary"
+    # Load binfile and start the inferior.  Use gdb_load, so that the
+    # board sets this inferior up too: the remote exec-file is per
+    # inferior.
+    if {[gdb_load ${binfile}] != 0} {
+	return
+    }
 
     if {![runto_main]} {
 	return
-- 
2.56.0


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

end of thread, other threads:[~2026-11-23 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-08 18:59 [PATCH] gdb/testsuite: set up the new inferior in remove-inferiors.exp Josip Seketa
2026-11-23 16:05 ` Rohr, Stephan
2026-11-23 19:25   ` Josip Seketa
2026-11-23 19:26   ` [PATCH v2] " Josip Seketa

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