[binutils-gdb] gdb/testsuite: set up the new inferior in remove-inferiors.exp

Andrew Burgess aburgess@sourceware.org
Wed Dec 2 16:31:13 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=06a6401d80d11956e28925a76ddefe8f0f9ae80d

commit 06a6401d80d11956e28925a76ddefe8f0f9ae80d
Author: Josip Seketa <josip.seketa@gmail.com>
Date:   Mon Nov 23 19:26:12 2026 +0000

    gdb/testsuite: set up the new inferior in remove-inferiors.exp
    
    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.
    
    Reviewed-By: Stephan Rohr <stephan.rohr@intel.com>
    Approved-By: Andrew Burgess <aburgess@redhat.com>

Diff:
---
 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..c81c50c06b6 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


More information about the Gdb-cvs mailing list