mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
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.
This commit is contained in:
parent
2f2924078c
commit
ca2f7c8492
@ -186,7 +186,7 @@ cplus_demangle (const char *mangled, int options)
|
||||
if (GNAT_DEMANGLING)
|
||||
return ada_demangle (mangled, options);
|
||||
|
||||
if (DLANG_DEMANGLING)
|
||||
if (DLANG_DEMANGLING || AUTO_DEMANGLING)
|
||||
{
|
||||
ret = dlang_demangle (mangled, options);
|
||||
if (ret)
|
||||
|
@ -1470,3 +1470,8 @@ demangle.anonymous
|
||||
--format=dlang
|
||||
_D8demangle9anonymous03fooZ
|
||||
demangle.anonymous.foo
|
||||
#
|
||||
# Test that 'auto' works.
|
||||
--format=auto
|
||||
_D8demangle9anonymous03fooZ
|
||||
demangle.anonymous.foo
|
||||
|
Loading…
Reference in New Issue
Block a user