public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix gnatmake_version_at_least
@ 2020-02-13  7:37 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-02-13  7:37 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f3b0f7fe42309fa0e00b4d2074b0faefbf2e8ffd

commit f3b0f7fe42309fa0e00b4d2074b0faefbf2e8ffd
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Feb 13 08:37:34 2020 +0100

    [gdb/testsuite] Fix gnatmake_version_at_least
    
    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.
    
    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.

Diff:
---
 gdb/testsuite/ChangeLog   | 5 +++++
 gdb/testsuite/lib/ada.exp | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 0682674..6abc56c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-13  Tom de Vries  <tdevries@suse.de>
+
+	* lib/ada.exp (gnatmake_version_at_least): Wrap exec call in a catch
+	call.
+
 2020-02-11  Sergio Durigan Junior  <sergiodj@redhat.com>
 
 	PR tui/25126
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index f8a6a72..726977d 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 } {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-13  7:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  7:37 [binutils-gdb] [gdb/testsuite] Fix gnatmake_version_at_least Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).