-
Notifications
You must be signed in to change notification settings - Fork 44
Arch-independent demangling and add gnuv2_demangle
for old g++ projects
#262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big improvement!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this .
trimming logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just add it for itanium/gnuv2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_demangle
be 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 invertcwdemangle
andcpp_demangle
since it is more likely for cw to be used in mips than a new g++.