Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gnatmake_version_at_least
Date: Thu, 13 Feb 2020 07:38:00 -0000	[thread overview]
Message-ID: <20200213073805.GA30841@delia> (raw)

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  <tdevries@suse.de>

	* 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 } {


                 reply	other threads:[~2020-02-13  7:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200213073805.GA30841@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox