From patchwork Fri Aug 16 16:26:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34151 Received: (qmail 18097 invoked by alias); 16 Aug 2019 16:26:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 18045 invoked by uid 89); 16 Aug 2019 16:26:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*muller X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Aug 2019 16:26:23 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D32DBAE36; Fri, 16 Aug 2019 16:26:21 +0000 (UTC) Date: Fri, 16 Aug 2019 18:26:20 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Pierre Muller , Keith Seitz Subject: [PATCH][gdb/testsuite] Clean up stale exec in gdb_compile_pascal Message-ID: <20190816162618.GA19652@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, When running a pascal test with the stabs target board: ... $ test=gdb.pascal/case-insensitive-symbols.exp $ cd build/gdb/testsuite $ make check RUNTESTFLAGS="$test --target_board=stabs" ... we get: ... nr of untested testcases 1 nr of unsupported tests 1 ... due to: ... Error: Illegal parameter: -gstabs+^M Error: /usr/bin/ppcx64 returned an error exitcode^M ... OTOH, when running the same pascal test without the stabs target board: ... $ make check RUNTESTFLAGS="$test" ... we get: ... nr of expected passes 20 ... But when subsequently again running with the stabs target board: ... $ make check RUNTESTFLAGS="$test --target_board=stabs" ... we now get: ... nr of expected passes 20 ... The problem is that gdb_compile_pascal determines success based on existence of the exec after compilation: ... if ![file exists $destfile] { unsupported "Pascal compilation failed: $result" return "Pascal compilation failed." } ... without removing the exec before compilation, which allows a stale exec to make it seem as if compilation has succeeded. Fix this by removing the stale exec before compilation. OK for trunk? Thanks, - Tom [gdb/testsuite] Clean up stale exec in gdb_compile_pascal gdb/testsuite/ChangeLog: 2019-08-16 Tom de Vries * lib/pascal.exp (gdb_compile_pascal): Remove $destfile before compilation. --- gdb/testsuite/lib/pascal.exp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp index 796c2a781e..dcdbb8d1f9 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -153,6 +153,8 @@ proc gdb_compile_pascal {source destfile type options} { pascal_init } + file delete $destfile + if { $pascal_compiler_is_fpc == 1 } { set result [fpc_compile $source $destfile $type $options] } elseif { $pascal_compiler_is_gpc == 1 } {