Bug 486162

Summary: [Request] Extend Demangle support
Product: [Applications] Heaptrack Reporter: Matheus Catarino <matheus-catarino>
Component: generalAssignee: Milian Wolff <mail>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: heaptrack show dlang mangled functions (druntime internal)

Description Matheus Catarino 2024-04-26 14:44:18 UTC
Created attachment 168922 [details]
heaptrack show dlang mangled functions (druntime internal)

Similar references
- https://bugs.kde.org/show_bug.cgi?id=481485
- https://bugs.kde.org/show_bug.cgi?id=458175
- https://bugs.kde.org/show_bug.cgi?id=372182

Request to extend support also to other ABIs, like Rust, Swift, D and any mangled ABI.

Following the attachment of this report, I'm trying to investigate a possible case of DRuntimeGC memory leak on archlinux/glibc and cannot detect the same problem on alpine/musl.

I don't know if it helps, but I do know that kdab/hotspot and kdab/perfparser have support through 3rd party demangle-libraries to support Rust('_R') [v0 mangle] and D ('_D').
If this is a starting point to be added, great.
https://github.com/KDAB/hotspot/blob/1ac3ff2e885f381e0dfe86204eab0f9f82b84553/scripts/appimage/Dockerfile#L81-L100
Comment 1 Matheus Catarino 2024-04-26 14:50:20 UTC
Comment on attachment 168922 [details]
heaptrack show dlang mangled functions (druntime internal)

D code:
void main() {}

command: ldmd2 foo.d

For this print has used ldc2 (LLVM D Compiler), but same result on any D compiler.

By default using extern(D) - D ABI '_D'
extern(C++) - C++ ABI, demangle works
extern(C) - like betterC, no issue