[Lldb-commits] [lldb] [LLDB] Handle i686 mingw32 mangling prefix (PR #160930)

via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 30 02:29:02 PDT 2025


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 at 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


More information about the lldb-commits mailing list