Bug 11586 – core.demangle should understand _D16TypeInfo_HAyayAa6__initZ etc.

Status
NEW
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-23T19:47:24Z
Last change time
2024-12-07T13:33:04Z
Keywords
mangling
Assigned to
No Owner
Creator
Adam D. Ruppe
Moved to GitHub: dmd#17125 →

Comments

Comment #0 by destructionator — 2013-11-23T19:47:24Z
I talked about it in detail here: http://forum.dlang.org/thread/[email protected]?page=2#post-vcafquufzkrpuaqktqbr:40forum.dlang.org shorter version: I think the reason that "_D16TypeInfo_HAyayAa6__initZ" couldn't get automatically demangled is because it is a special name that doesn't actually follow the ABI spec. It's compiler generated info whose mangle looks kinda like a function, but it lacks the calling convention or return value that core.demangle requires to be there to consider a valid name. [...] So that crazy name "TypeInfo_HAyayAa" actually follows the very same pattern. This might be the one time outside eyeball debugging when knowing your mangles by hand is actually useful! On the other hand, perhaps it'd be a good idea to add recognition of this pattern to core.demangle, so it can print out the much prettier typeid(immutable char[][immutable(char)[]]) cuz that's how you'd likely refer to it in code anyway. * * * The underlying bug that produces the linker error in the first place ought to be fixed too (though over the years, I've been unable to produce a reliable test case! it seems to come and go at random, I think presence of other code that uses it or compile command line order may affect it, but have never isolated the problem). Anyway, at least adding support for the name here will help future people debug it without having to know all the mangling rules.
Comment #1 by robert.schadek — 2024-12-07T13:33:04Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17125 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB