aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-03-30 13:48:30 -0600
committerTom Tromey <tom@tromey.com>2024-04-02 13:53:13 -0600
commitb1741ab0dafd899889faab6e862094a325a6b83c (patch)
tree3fcf74e9cc61a31f021e3d8bb6fa406800bd68bf /gdb
parent251cedaeb57fe1e0fd28798f476fbee75373bbf4 (diff)
downloadgdb-b1741ab0dafd899889faab6e862094a325a6b83c.zip
gdb-b1741ab0dafd899889faab6e862094a325a6b83c.tar.gz
gdb-b1741ab0dafd899889faab6e862094a325a6b83c.tar.bz2
libiberty: Invoke D demangler when --format=auto
Investigating GDB PR d/31580 showed that the libiberty demangler doesn't automatically demangle D mangled names. However, I think it should -- like C++ and Rust (new-style), D mangled names are readily distinguished by the leading "_D", and so the likelihood of confusion is low. The other non-"auto" cases in this code are Ada (where the encoded form could more easily be confused by ordinary programs) and Java (which is long gone, but which also shared the C++ mangling and thus was just an output style preference). This patch also fixed another GDB bug, though of course that part won't apply to the GCC repository. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31580 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30276 libiberty * cplus-dem.c (cplus_demangle): Try the D demangler with "auto" format. * testsuite/d-demangle-expected: Add --format=auto test.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.dlang/dlang-start-2.exp4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.dlang/dlang-start-2.exp b/gdb/testsuite/gdb.dlang/dlang-start-2.exp
index 4b3163e..284f841 100644
--- a/gdb/testsuite/gdb.dlang/dlang-start-2.exp
+++ b/gdb/testsuite/gdb.dlang/dlang-start-2.exp
@@ -79,10 +79,8 @@ if {[gdb_start_cmd] < 0} {
return -1
}
-# We should probably have "D main" instead of "_Dmain" here, filed PR30276
-# '[gdb/symtab] function name is _Dmain instead of "D main"' about that.
gdb_test "" \
- "in _Dmain \\(\\)" \
+ "in D main \\(\\)" \
"start"
gdb_test "show language" {"auto; currently d".}