From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [pushed] Disable gdb.ada/dgopt.exp with gnat-llvm
Date: Fri, 26 Jun 2026 10:52:43 -0600 [thread overview]
Message-ID: <20260626165243.1865725-1-tromey@adacore.com> (raw)
gdb.ada/dgopt.exp fails with gnat-llvm.
Looking into it, it turns out that this test case relies on a bug in
GNAT. In particular, despite the use of -gnatDG, GNAT will still put
a reference to "x.adb" into both the DWARF .debug_info and into the
line table. The test relies on this, because the original problem
being fixed here is that, when the test was written, there was a bug
causing these references to be dropped when writing .debug_names.
gnat-llvm does not have this same bug -- it only emits references to
x.adb.dg.
This patch disables this test for gnat-llvm. There's not really a
good way to tell that gnatmake is llvm-based, so while I've added a
new caching proc for this, it is just a proxy for an existing proc.
Since this only affects gnat-llvm, and was discussed internally, I am
going to check it in.
---
gdb/testsuite/gdb.ada/dgopt.exp | 8 ++++++++
gdb/testsuite/lib/ada.exp | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/gdb/testsuite/gdb.ada/dgopt.exp b/gdb/testsuite/gdb.ada/dgopt.exp
index 9e8e8a676a8..831aa053f36 100644
--- a/gdb/testsuite/gdb.ada/dgopt.exp
+++ b/gdb/testsuite/gdb.ada/dgopt.exp
@@ -19,6 +19,14 @@ load_lib "ada.exp"
require allow_ada_tests
+# Despite appearances, this is not really an "Ada" test -- instead the
+# scenario here is that GNAT ends up putting one reference to x.adb
+# into the DWARF (whereas it mostly refers to x.adb.dg); and this
+# reference was being incorrectly omitted from .debug_names.
+# gnat-llvm does not have this bug, so the test does not make sense
+# there.
+require !using_gnat_llvm
+
standard_ada_testfile x
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable \
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 8c9821bb897..e20b35c8ebe 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -292,6 +292,14 @@ gdb_caching_proc ada_minimal_encodings {} {
additional_flags=-fgnat-encodings=minimal]
}
+# Return 1 if GNAT is based on LLVM.
+gdb_caching_proc using_gnat_llvm {} {
+ # Whether or not gnatmake will use LLVM can't be determined from
+ # the command line -- e.g., --version doesn't provide any
+ # indication. So for now use a proxy.
+ return [expr {![ada_minimal_encodings]}]
+}
+
# Return 1 if GNAT supports -Og.
gdb_caching_proc ada_og {} {
return [ada_simple_compile gnat_og additional_flags=-Og]
base-commit: 108db853326a1335fadb6d0ad9955dd7714b1ce1
--
2.54.0
reply other threads:[~2026-06-26 16:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260626165243.1865725-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