Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Avoid minimal language when DW_LANG_HIP is used.
@ 2026-02-17 19:50 Allyson Cauble-Chantrenne
  2026-02-18 18:39 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Allyson Cauble-Chantrenne @ 2026-02-17 19:50 UTC (permalink / raw)
  To: gdb-patches; +Cc: Allyson Cauble-Chantrenne

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-27 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-17 19:50 [PATCH] Avoid minimal language when DW_LANG_HIP is used Allyson Cauble-Chantrenne
2026-02-18 18:39 ` Tom Tromey
2026-02-27 19:32   ` Simon Marchi
2026-02-27 19:39     ` Cauble-Chantrenne, Allyson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox