]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Assume an unrecognized gnatmake is very new
authorTom Tromey <tromey@adacore.com>
Wed, 1 Jul 2026 16:05:24 +0000 (10:05 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 17 Jul 2026 16:37:18 +0000 (10:37 -0600)
I don't know why -- though I suspect there may have been a change to
the output of "gnatmake --version" -- but recently some gdb.ada tests
have stopped running when llvm-gnatmake is used.

The llvm-gnatmake I am testing against prints a version string that
isn't recognized by gnat_version_compare.  However, it seems to me
that AdaCore is probably the main place where this can even occur; and
furthermore that without some extra work, it seems reasonable for
gnat_version_compare to assume that an unrecognized gnatmake is "very
new".

gdb/testsuite/lib/ada.exp

index e20b35c8ebe2326fabb8e42fc04e3ca1fe0c82f1..086866aca99126300fa07d198df4d4d46863df37 100644 (file)
@@ -180,7 +180,8 @@ proc find_ada_tool {tool} {
 }
 
 # Compare the GNAT version against L2 using version_compare.  If the
-# compiler does not appear to be GCC, this will always return false.
+# compiler does not appear to be GCC, this will assume that gnatmake
+# is very new.
 
 proc gnat_version_compare {op l2} {
     set gnatmake [find_gnatmake]
@@ -189,7 +190,8 @@ proc gnat_version_compare {op l2} {
        return 0
     }
     if {![regexp {GNATMAKE ([0-9]+(\.[0-9]+)*)} $output match version]} {
-       return 0
+       # Assume a "very new" version.
+       set version 99
     }
 
     return [version_compare [split $version .] $op $l2]