Arch-independent demangling and add gnuv2_demangle for old g++ projects#262
Arch-independent demangling and add gnuv2_demangle for old g++ projects#262encounter merged 8 commits intoencounter:mainfrom
gnuv2_demangle for old g++ projects#262Conversation
|
I've seen old and new mangling formats in gcc built binaries for Windows and Mac so it's definitely not a old mips binary exclusive thing |
|
What arch is used for Mac? I assume Windows uses x86, but dunno what Mac uses. Maybe ppc? |
gnuv2_demangle for better demangling of old g++ compiled projectsgnuv2_demangle for better demangling of old g++ compiled projects
Yes it is ppc/intel but most likely ppc |
gnuv2_demangle for better demangling of old g++ compiled projectsgnuv2_demangle for old g++ projects
| if name.starts_with('?') { | ||
| msvc_demangler::demangle(name, msvc_demangler::DemangleFlags::llvm()).ok() | ||
| } else { | ||
| name = name.trim_start_matches('.'); |
There was a problem hiding this comment.
Let's keep this . trimming logic
There was a problem hiding this comment.
From what I can see only ppc has this trimming logic.
Do you want to always trim . when the demangler is not msvc? Or should it be only be applied to specific demanglers (cpp_demangle, cwdemangle, etc) ?
There was a problem hiding this comment.
I think we can just add it for itanium/gnuv2
There was a problem hiding this comment.
Gotcha.
btw, I'm a bit curious, do you have an example a mangled symbol like this? I would like to take an small look at it.
It is okay if you don't have any, don't worry much about it.
| if name.starts_with('?') { | ||
| msvc_demangler::demangle(name, msvc_demangler::DemangleFlags::llvm()).ok() | ||
| } else { | ||
| name = name.trim_start_matches('.'); |
There was a problem hiding this comment.
I think we can just add it for itanium/gnuv2
PPC and later x86, usually both target elfs packed in another elf, later then PPC was made obsolete just x86 |

I tested it locally and works fine.
I'm unsure about a few things.
cpp_demanglebe removed from mips? I don't know if there's any mips project that uses a new enough g++ compiler that uses the new mangling abi. Or maybe invertcwdemangleandcpp_demanglesince it is more likely for cw to be used in mips than a new g++.