-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Consider demangling symbols #67
Comments
Hello 👋🏼 Thanks for the suggestion! I think it very much makes sense :)
Yup, that's what I was thinking. Simply add another key binding (maybe
I haven't worked extensively with mangling libraries/tooling so I have some questions:
Agreed. |
Also, I found |
I think you may find the name mangling wikipedia page worth a read. To summarize its key points:
To this, I can add that in the Real World, programs will have a mixture of mangled and non-mangled symbols, because you need non-mangled symbols for interop with C-minded infrastructure, e.g. linkers and loaders. You can handle this in various ways. In |
Thanks for the summary, it made everything more clear :)
I was actually planning to support more formats in the future, but that's shouldn't be a concern for now. See #26 - I'd love to get your opinion on it as well.
Hmm, interesting. I found this RFC but not quite sure about the latest status of it.
Yeah, sounds reasonable and I think that's the path that I will be taking. |
I'm afraid I'm not knowledgeable enough about binary file formats to evaluate how good this abstraction layer is :) If I knew more, my first questions would be...
All that being said, the QuarksLab company is quite reputable in the French security community, so it does give a good first impression from a future maintenance and expected feature-completeness perspective.
Indeed, I've just cross-checked a rust binary that I've built recently and the mangled symbols still start with _Z, so it seems to me that if this is merged into rustc, it may not be on-by-default yet. The wikipedia page may need some amending... |
Those are good questions - I think we'll be able to answer them better after starting the implementation.
That's my biggest concern, losing some data in the TUI due to the abstraction...
Yeah.. or that..
It can't be worse than the issues that I'm having with Linux-specific dependencies (e.g.
I will look into them later on. But either way, doing this for other file formats will require some abstraction. Thanks for sharing the links! |
Is your feature request related to a problem? Please describe.
Symbols from C++ and Rust programs (or any other AoT-compiled programming language that uses the Itanium name mangling ABI) can be quite hard to map back to source code without demangling, especially in the presence of generics.
Describe the solution you'd like
It would be nice if binsider had an on-by-default option to demangle Itanium ABI symbols. The option could be toggled either via CLI or via a TUI shortcut. I've been using cpp_demangle to this end in crofiler as a pure-rust solution and it worked pretty well, although it does have a few edge cases where it does not perfectly match libiberty.
Describe alternatives you've considered
Demangling can also be done in many other ways, such as by binding to libiberty or calling the c++filt utility. Alternatively, you may also decide that demangling is not worth the code complexity cost. Or you may not want to provide an option to disable it for UI simplicity. I've seen a few demangling hiccups in tools I use (especially perf), which is why I think it's good to have a way to turn it off.
If you do want to have demangling, another UI design option besides an on/off TUI shortcut would be to have two columns in the symbol table, one with the mangled name and one with the non-mangled name, but I think this table is already a bit crowded for that...
Additional context
Prior art of common ELF-wrangling tools that can perfom demangling and do so by default, with an option to disable it, includes the perf profiler and the GDB debugger.
The text was updated successfully, but these errors were encountered: