MASTG-TECH-0114: Demangling Symbols
To make some identifiers unique within the program, the compiler processes their symbol names. This process is called "name mangling" or simply "mangling". Often, the resulting symbols are complex for humans to interpret. Additionally, their format is specific to the input language and the compiler and may even be version-dependent.
You can use demangling tools to reverse the mangling process. For Swift, see swift-demangle and for C++ function names, c++filt.
swift-demangle¶
Pass the mangled symbol to swift-demangle:
$ xcrun swift-demangle __T0So9WKWebViewCABSC6CGRectV5frame_So0aB13ConfigurationC13configurationtcfcTO
_T0So9WKWebViewCABSC6CGRectV5frame_So0aB13ConfigurationC13configurationtcfcTO ---> @nonobjc __C.WKWebView.init(frame: __C_Synthesized.CGRect, configuration: __C.WKWebViewConfiguration) -> __C.WKWebView
c++filt¶
You can demangle C++ symbols with c++filt:
c++filt _ZSt6vectorIiSaIiEE
std::vector<int, std::allocator<int>>