objdiff icon indicating copy to clipboard operation
objdiff copied to clipboard

MSVC name demangler cannot demangle COM ptr mangled names

Open ZivDero opened this issue 5 months ago • 3 comments

When using COM pointers, MSVC emits pretty long mangled names. Example: ?_Release@?$_com_ptr_t@V?$_com_IIID@UIPiggyback@@$1?IID_IPiggyback@@3U_GUID@@B@@@@AAEXXZ per http://demangler.com/ results in struct _GUID const _IPiggyback::_com_ptr_t::_Release

Objdiff fails to demangle these and leaves them as-is.

ZivDero avatar Sep 05 '25 23:09 ZivDero

This is an issue with the upstream demangler crate msvc-demangler, and should be filed there.

ieee802dot11ac avatar Sep 06 '25 00:09 ieee802dot11ac

This is an issue with the upstream demangler crate msvc-demangler, and should be filed there.

Filed. https://github.com/mstange/msvc-demangler-rust/issues/79 Though something tells me it may not get resolved...

Would it be infeasible to attempt to use native de-mangling utilities when possible to avoid this? UnDecorateSymbolName function (dbghelp.h) in this case.

ZivDero avatar Sep 06 '25 13:09 ZivDero

Unfortunately calling out to the system library is pretty difficult (and not cross-platform).

https://github.com/Ryan-rsm-McKenzie/undname-rs claims it has better accuracy than msvc-demangler, may be worth checking out.

I’ve made a PR to msvc-demangler in the past and it was merged pretty quickly, so adding support for COM names is always an option.

encounter avatar Sep 06 '25 14:09 encounter