From patchwork Thu Feb 13 07:38:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 38020 Received: (qmail 74780 invoked by alias); 13 Feb 2020 07:38:13 -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 74188 invoked by uid 89); 13 Feb 2020 07:38:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 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= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 07:38:11 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C7891AD69 for ; Thu, 13 Feb 2020 07:38:08 +0000 (UTC) Date: Thu, 13 Feb 2020 08:38:07 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gnatmake_version_at_least Message-ID: <20200213073805.GA30841@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, After de-installing gnatmake, I get: ... Running src/gdb/testsuite/gdb.ada/rename_subscript_param.exp ... ERROR: tcl error sourcing src/gdb/testsuite/gdb.ada/rename_subscript_param.exp. ERROR: couldn't execute "gnatmake": no such file or directory while executing "exec $gnatmake --version" (procedure "gnatmake_version_at_least" line 4) ... Fix this by wrapping the exec call in a catch call. Tested with and withouth gnatmake installed on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gnatmake_version_at_least gdb/testsuite/ChangeLog: 2020-02-13 Tom de Vries * lib/ada.exp (gnatmake_version_at_least): Wrap exec call in a catch call. --- gdb/testsuite/lib/ada.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index f8a6a723bb..726977d98f 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -136,7 +136,9 @@ proc find_ada_tool {tool} { proc gnatmake_version_at_least { major } { set gnatmake [gdb_find_gnatmake] set gnatmake [lindex [split $gnatmake] 0] - set output [exec $gnatmake --version] + if {[catch {exec $gnatmake --version} output]} { + return 0 + } if { [regexp {GNATMAKE ([^ .]+).([^ .]+).([^ .]+)} $output \ match gnatmake_major gnatmake_minor gnatmake_micro] } { if { $gnatmake_major >= $major } {