Created attachment 155749 [details] d-lang-demangling.patch See patch. Related to bug #445235
Where is dlang_demangle ? It looks external to me.
coregrind/m_demangle/d-demangle.c provides dlang_demangle it comes from libiberty from which we import the demangler from time to time. See auxprogs/update-demangler. Last import was: commit e0b62fe05559003b731b4d786f3b71e9a66fb94d Author: Mark Wielaard <mark@klomp.org> Date: Thu Feb 17 18:35:38 2022 +0100 Update libiberty demangler Update the libiberty demangler using the auxprogs/update-demangler script to gcc git commit d3b2ead595467166c849950ecd3710501a5094d9. This update includes: - libiberty rust-demangle, ignore .suffix - libiberty: Fix infinite recursion in rust demangler - Update copyright years - libiberty: support digits in cpp mangled clone names - d-demangle: properly skip anonymous symbols - d-demangle: remove parenthesis where it is not needed
OK that reminds me of https://bugs.kde.org/show_bug.cgi?id=445235 IIRC we don't want the build/tests to rely on having all compilers avalable so to test the trick is to use a C program using D mangled symbols.
And the other bugzi was already mentioned.
Very quick test, I used one of the functions here: https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/ To write #include <iostream> extern "C" void _D4test4findFiPxaZPxa() { int a; if (a) std::cout << "a\n"; else std::cout << "!a\n"; } int main() { _D4test4findFiPxaZPxa(); } Without the patch ==4757== Conditional jump or move depends on uninitialised value(s) ==4757== at 0x2025FC: _D4test4findFiPxaZPxa (d.cpp:6) With the patch ==4760== Conditional jump or move depends on uninitialised value(s) ==4760== at 0x2025FC: test.find(int, const(char)*) (d.cpp:6)
Yes. "_D4test4findFiPxaZPxa" , is mangling for "test.find(int, const(char)*)", or for "const(char)* find(int, const(char)*)" if one also includes the return type. Thanks for adding a test.
commit 82282a6676a5c1b3784fd22fc097a0076dfcb7ca (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Sun Jan 29 22:05:27 2023 +0100 Bug 464969 - D language demangling Patch from witold.baryluk@gmail.com (also added a testcase)