[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.
This commit is contained in:
Tom de Vries
2020-02-13 08:37:34 +01:00
parent d1437c0ea6
commit f3b0f7fe42
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

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