[binutils-gdb] gdb/testsuite: avoid PID in test name

Andrew Burgess via Gdb-cvs <[email protected]> Tue, 16 Jun 2026 19:56:39 +0000 (GMT)
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=60466ce68ac1a2d93c7f39b2638e24f48125fbf9

commit 60466ce68ac1a2d93c7f39b2638e24f48125fbf9
Author: Andrew Burgess <[email protected]>
Date:   Tue Jun 16 20:22:46 2026 +0100

    gdb/testsuite: avoid PID in test name
    
    In gdb.python/py-inf-exited-at-exit.exp, switch to using gdb_attach
    proc when attaching in order to avoid including the process-id in the
    test name.
    
    There should be no change to what is being tested after this commit.

Diff:
---
 gdb/testsuite/gdb.python/py-inf-exited-at-exit.exp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.python/py-inf-exited-at-exit.exp b/gdb/testsuite/gdb.python/py-inf-exited-at-exit.exp
index 820858bd75d..3b6764abff7 100644
--- a/gdb/testsuite/gdb.python/py-inf-exited-at-exit.exp
+++ b/gdb/testsuite/gdb.python/py-inf-exited-at-exit.exp
@@ -122,7 +122,10 @@ proc_with_prefix check_with_attach {} {
 
     gdb_breakpoint [gdb_get_line_number "Break here."]
 
-    gdb_test "attach $testpid"
+    if { ![gdb_attach $testpid] } {
+	kill_wait_spawned_process $test_spawn_id
+	return
+    }
 
     gdb_continue_to_breakpoint "continue to b/p in foo"