Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Assume an unrecognized gnatmake is very new
Date: Wed,  1 Jul 2026 13:13:29 -0600	[thread overview]
Message-ID: <20260701191329.2287960-1-tromey@adacore.com> (raw)

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index e20b35c8ebe..086866aca99 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -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]

base-commit: c2d4b5e1135f75f7e4ef7ff68fa899bfe483671b
-- 
2.54.0


             reply	other threads:[~2026-07-01 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 19:13 Tom Tromey [this message]
2026-07-17 16:37 ` Tom Tromey

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=20260701191329.2287960-1-tromey@adacore.com \
    --to=tromey@adacore.com \
    --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