Michael137 wrote:

> I think it's plausible that `llvm/lib/Demangle` also just accepts `__Z` as 
> itanium prefix - which I presume that this PR does (I haven't had time to 
> look at the code yet).

It actually does (which is why on macOS you can pass `__Z` symbols to `c++filt` 
and it works just fine: https://github.com/llvm/llvm-project/pull/106233).

The problem here is that LLDB tries to distinguish Itanium symbols from 
non-Itanium ones, and it uses `_Z` definitively. I don't think there's much 
harm in adding to that list `__Z`, basically forwarding the responsibility of 
stripping the symbol to the demangler (which is what other tools already do 
anyway). I just wanted to make sure we don't bandage over another bug. But it 
sounds like this is just a new issue specific to how mangled names get emitted 
for MSVC.

E.g., on Darwin (another platform where a leading underscore is added), we 
don't run into this issue. I think that's because we strip the leading 
underscore before putting it into DWARF. But it sounds like MSVC doesn't do 
that.

So TL;DR, happy to not do the stripping and adjust the 
`Mangled::GetManglingScheme` code.

https://github.com/llvm/llvm-project/pull/160930
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to