From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 3AA0A3858D3C; Tue, 8 Nov 2022 15:28:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AA0A3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667921297; bh=lunLgsW+YYXg2xgKwCxKFx69kZJSCVxghcr8U7a703I=; h=From:To:Subject:Date:From; b=ZC57Ccz9I723Pwj1L7T9W9rfhcjfQuH5rwsrRv+1K3caE6gYWSlCqxqabBgNVMq1h +ECa4egH1NABdVyYw14hzWGeAz7oOXYvjTwPXkP6OH91GDYDi2qmjnUHyJvMKHbdWI Y1OrfaCH/esbMtHz1MerWfSsyqpaaZ+PFpTLllFk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix find_core_file for core named core X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 2756004fe78954754946b61d3f6338d8b72b8332 X-Git-Newrev: e406987c476ebb229d04cd606bae2215386b189c Message-Id: <20221108152817.3AA0A3858D3C@sourceware.org> Date: Tue, 8 Nov 2022 15:28:16 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3De406987c476e= bb229d04cd606bae2215386b189c commit e406987c476ebb229d04cd606bae2215386b189c Author: Tom de Vries Date: Tue Nov 8 16:28:11 2022 +0100 [gdb/testsuite] Fix find_core_file for core named core =20 With test-case gdb.base/bigcore.exp I run into: ... (gdb) PASS: gdb.base/bigcore.exp: get inferior pid signal SIGABRT^M Continuing with signal SIGABRT.^M ^M Program terminated with signal SIGABRT, Aborted.^M The program no longer exists.^M (gdb) PASS: gdb.base/bigcore.exp: signal SIGABRT UNTESTED: gdb.base/bigcore.exp: can't generate a core file ... due to find_core_file returning "". =20 There is a core file name core: ... $ ls ./outputs/gdb.base/bigcore bigcore bigcore.corefile core gdb.cmd.1 gdb.in.1 gdbserver.cmd.1 ... but it's not found. =20 The problem is this statement: ... lappend files [list ${::testfile}.core core] ... which adds a single list item "${::testfile}.core core". =20 Fix this in the most readable way: ... lappend files ${::testfile}.core lappend files core ... =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/lib/gdb.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e2cda30b95a..3e0a46445ca 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -7736,7 +7736,8 @@ proc find_core_file {pid} { } elseif {$pid !=3D -1} { lappend files core.$pid } - lappend files [list ${::testfile}.core core] + lappend files ${::testfile}.core + lappend files core =20 foreach file $files { if {![is_remote host]} {