aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/ada.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib/ada.exp')
-rw-r--r--gdb/testsuite/lib/ada.exp15
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 0a1231b..50067eb 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -1,4 +1,4 @@
-# Copyright 2004-2024 Free Software Foundation, Inc.
+# Copyright 2004-2025 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -181,12 +181,16 @@ proc find_ada_tool {tool} {
# compiler does not appear to be GCC, this will always return false.
proc gnat_version_compare {op l2} {
- set gccvers [gcc_major_version]
- if {$gccvers == -1} {
+ set gnatmake [find_gnatmake]
+ set gnatmake [lindex [split $gnatmake] 0]
+ if {[catch {exec $gnatmake --version} output]} {
+ return 0
+ }
+ if {![regexp {GNATMAKE ([0-9]+(\.[0-9]+)*)} $output match version]} {
return 0
}
- return [version_compare [split $gccvers .] $op $l2]
+ return [version_compare [split $version .] $op $l2]
}
# Return 1 if the GNAT runtime appears to have debug info.
@@ -216,7 +220,8 @@ proc gnat_runtime_has_debug_info_1 { shared } {
return 0
}
- clean_restart $dst
+ clean_restart
+ gdb_load $dst
if { ! [runto "GNAT_Debug_Info_Test"] } {
return 0