From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7833) id 746793858287; Fri, 4 Nov 2022 16:18:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 746793858287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667578713; bh=gCOjYK2mpxLFKsl9/qiGSK4SGBG6VII4tgRRv9uLdRk=; h=From:To:Subject:Date:From; b=DsLoMT+9/QadLNIUMhZL2OPF4NzcWcjFRuv8ZdYrjhvOOpA4c/OwrppGjdUzGIVYi yCCd0wk/za6M7rJCjPoPPX3SQKT+GAh90VHPmcYJZ6mLg49zAcGt5i4ftg/E5C4R9s Kp+xM4rBgShOmuQ60rw/TAd6yJ9qSKI4mW2bxaUk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Lancelot SIX To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [testsuite] gdb.base/dlmopen: Fix test name and use gdb_attach X-Act-Checkin: binutils-gdb X-Git-Author: Lancelot SIX X-Git-Refname: refs/heads/master X-Git-Oldrev: 45830439cef3c827ae5ddb3915a1edcf1206dc77 X-Git-Newrev: 36354a49b603408daf579d71a9684a0fc37311a7 Message-Id: <20221104161833.746793858287@sourceware.org> Date: Fri, 4 Nov 2022 16:18:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D36354a49b603= 408daf579d71a9684a0fc37311a7 commit 36354a49b603408daf579d71a9684a0fc37311a7 Author: Lancelot SIX Date: Fri Nov 4 15:36:21 2022 +0000 [testsuite] gdb.base/dlmopen: Fix test name and use gdb_attach =20 One test name in gdb.base/dlmopen.exp changes from run to run since it includes a process id: =20 PASS: gdb.base/dlmopen.exp: attach 3442682 =20 This is not convenient do diff gdb.sum files to compare test runs. =20 Fix by using gdb_attach helper function to handle attaching to the process as it produce a constant test name. =20 While at it also check gdb_attach's return value to only run the rest of the test if the attach was successful. =20 Approved-By: Simon Marchi 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/dl= mopen.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] =20 # Attach. -gdb_test "attach $testpid" "Attaching to program.*, process $testpid.*" +if { ![gdb_attach $testpid] } { + return +} =20 with_test_prefix "attach" { # Remove the pause. We no longer need it.