From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id DD2CD3949F37 for ; Mon, 9 Mar 2020 14:34:45 +0000 (GMT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id ED6C6AE46; Mon, 9 Mar 2020 14:34:44 +0000 (UTC) Date: Mon, 9 Mar 2020 15:34:43 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix tcl error in cached_file Message-ID: <20200309143441.GA19025@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 14:34:46 -0000 Hi, When trying to run tests using target board cc-with-dwz after a clean build, I run into: ... ERROR: tcl error sourcing board description file for target cc-with-tweaks.exp. couldn't open "build/gdb/testsuite/cache/gdb.sh.17028": \ no such file or directory couldn't open "build/gdb/testsuite/cache/gdb.sh.17028": \ no such file or directory while executing "open $tmp_filename w" (procedure "cached_file" line 9) invoked from within "cached_file gdb.sh "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS \"\$@\"" 1" ... The problem is that cached_file is trying to create a file build/gdb/testsuite/cache/gdb.sh.17028 in a non-existing directory. Fix this by creating the cache dir in cached_file. Tested on x86_64-linux, with target board cc-with-tweaks, and native. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix tcl error in cached_file gdb/testsuite/ChangeLog: 2020-03-09 Tom de Vries * lib/gdb.exp (cached_file): Create cache dir. --- gdb/testsuite/lib/gdb.exp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 55e58584c8..9614e8dc87 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4958,6 +4958,9 @@ proc cached_file { filename txt {executable 0}} { return $filename } + set dir [file dirname $filename] + file mkdir $dir + set tmp_filename $filename.[pid] set fd [open $tmp_filename w] puts $fd $txt