From: Allyson Cauble-Chantrenne <acaublec@amd.com>
To: <gdb-patches@sourceware.org>
Cc: Allyson Cauble-Chantrenne <acaublec@amd.com>
Subject: [PATCH] Avoid minimal language when DW_LANG_HIP is used.
Date: Tue, 17 Feb 2026 13:50:37 -0600 [thread overview]
Message-ID: <20260217195201.387306-1-acaublec@amd.com> (raw)
AMD clang is going to start using DW_LANG_HIP instead of
DW_LANG_C_plus_plus_14 (see PR at
https://github.com/llvm/llvm-project/pull/181738). Rather than
falling back to the minimal language, this commit ensures that
GDB will still treat it like a C++ app. The commit also adds
a test to an existing one.
---
gdb/dwarf2/read.c | 1 +
gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index efe0b046f15..7937eb2a904 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -15147,6 +15147,7 @@ dwarf_lang_to_enum_language (ULONGEST lang)
case DW_LANG_C_plus_plus_17:
case DW_LANG_C_plus_plus_20:
case DW_LANG_C_plus_plus_23:
+ case DW_LANG_HIP:
language = language_cplus;
break;
case DW_LANG_D:
diff --git a/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp b/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
index 0c15cd5a988..5ec556cac69 100644
--- a/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
+++ b/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
@@ -67,7 +67,7 @@ proc do_test {cu_lang gdb_lang} {
}
proc do_test_with_prefix {cu_lang gdb_lang} {
- with_test_prefix $gdb_lang {
+ with_test_prefix $cu_lang\_$gdb_lang {
do_test $cu_lang $gdb_lang
}
}
@@ -77,3 +77,6 @@ proc do_test_with_prefix {cu_lang gdb_lang} {
# fallback.
do_test_with_prefix DW_LANG_C "c"
do_test_with_prefix DW_LANG_C_plus_plus "c\\+\\+"
+
+# Check that HIP shows c++ and not minimal
+do_test_with_prefix DW_LANG_HIP "c\\+\\+"
--
2.53.0
next reply other threads:[~2026-02-17 19:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 19:50 Allyson Cauble-Chantrenne [this message]
2026-02-18 18:39 ` Tom Tromey
2026-02-27 19:32 ` Simon Marchi
2026-02-27 19:39 ` Cauble-Chantrenne, Allyson
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=20260217195201.387306-1-acaublec@amd.com \
--to=acaublec@amd.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