public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [testsuite] gdb.base/dlmopen: Fix test name and use gdb_attach
@ 2022-11-04 16:18 Lancelot SIX
  0 siblings, 0 replies; only message in thread
From: Lancelot SIX @ 2022-11-04 16:18 UTC (permalink / raw)
  To: gdb-cvs

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

commit 36354a49b603408daf579d71a9684a0fc37311a7
Author: Lancelot SIX <lancelot.six@amd.com>
Date:   Fri Nov 4 15:36:21 2022 +0000

    [testsuite] gdb.base/dlmopen: Fix test name and use gdb_attach
    
    One test name in gdb.base/dlmopen.exp changes from run to run
    since it includes a process id:
    
        PASS: gdb.base/dlmopen.exp: attach 3442682
    
    This is not convenient do diff gdb.sum files to compare test runs.
    
    Fix by using gdb_attach helper function to handle attaching to the
    process as it produce a constant test name.
    
    While at it also check gdb_attach's return value to only run the
    rest of the test if the attach was successful.
    
    Approved-By: Simon Marchi <simon.marchi@efficios.com>

Diff:
---
 gdb/testsuite/gdb.base/dlmopen.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp
index a80db75f9ac..31f74008f10 100644
--- a/gdb/testsuite/gdb.base/dlmopen.exp
+++ b/gdb/testsuite/gdb.base/dlmopen.exp
@@ -159,7 +159,9 @@ set test_spawn_id [spawn_wait_for_attach $binfile]
 set testpid [spawn_id_get_pid $test_spawn_id]
 
 # Attach.
-gdb_test "attach $testpid" "Attaching to program.*, process $testpid.*"
+if { ![gdb_attach $testpid] } {
+    return
+}
 
 with_test_prefix "attach" {
     # Remove the pause.  We no longer need it.

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

only message in thread, other threads:[~2022-11-04 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 16:18 [binutils-gdb] [testsuite] gdb.base/dlmopen: Fix test name and use gdb_attach Lancelot SIX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).