Nerixyz wrote:

> Exactly. The extra underscore prefix on i386 isn't mingw specific either, 
> it's on MSVC as well - for regular C symbols. For other calling conventions 
> (like fastcall or vectorcall) the prefix is different though, and for MSVC 
> C++ mangled symbols, there's a different prefix. But Itanium C++ ABI on i386 
> works through the regular (cdecl) mangling, which adds a `_` prefix, just 
> like all regular plain C functions.

Ah, thank you for the clarification. Looking at [MS' 
docs](https://learn.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170#FormatC),
 I think we should instead have some preprocessing function in the PDB plugin 
that strips the C mangling to then pass the potentially mangled name to 
`Mangled`. For example, on non-64bit, `_CFuncParamStdCall@4` would be stripped 
to `CFuncParamStdCall` and then passed to `Mangled`. Similarly, the leading 
underscore of `__RNvCsj4CZ6flxxfE_7___rustc12___rust_alloc` would be removed. 
Does this sound reasonable? If so, I'd close this PR and implement this when 
relanding #149701.

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