-
Notifications
You must be signed in to change notification settings - Fork 339
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
Demangling of C++ names of Linux Binaries does not work on Mac OS #43
Comments
So, So the quick hack is to set a flag on the binary, and if the binary is not MachO, pass in Ubuntu: $ c++filt --version GNU c++filt (GNU Binutils for Ubuntu) 2.24 Copyright 2013 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. $ c++filt --help Usage: c++filt [options] [mangled names] Options are: [-_|--strip-underscore] Ignore first leading underscore [-n|--no-strip-underscore] Do not ignore a leading underscore (default) [-p|--no-params] Do not display function arguments [-i|--no-verbose] Do not show implementation details (if any) [-t|--types] Also attempt to demangle type encodings [-s|--format {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat}] [@] Read extra options from [-h|--help] Display this information [-v|--version] Show the version information Demangled names are displayed to stdout. If a name cannot be demangled it is just echoed to stdout. If no names are provided on the command line, stdin is read. Report bugs to . On Mac: $ c++filt --version GNU c++filt 070207 20070207 Copyright 2005 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. $ c++filt --help Usage: c++filt [options] [mangled names] Options are: [-_|--strip-underscore] Ignore first leading underscore (default) [-n|--no-strip-underscore] Do not ignore a leading underscore [-p|--no-params] Do not display function arguments [-i|--no-verbose] Do not show implementation details (if any) [-t|--types] Also attempt to demangle type encodings [-s|--format {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat}] [@] Read extra options from [-h|--help] Display this information [-v|--version] Show the version information Demangled names are displayed to stdout. If a name cannot be demangled it is just echoed to stdout. If no names are provided on the command line, stdin is read. |
Interesting. Since we are depending on a platform-specific tool, it makes sense to me that we pass it platform-specific flags. The knowledge that Linux binaries need the extra flag on OS X is pretty weird and arbitrary, but since a more principled solution is not presenting itself, let's go for the narrow/arbitrary solution for now. |
This should be fixed by #78. |
Steps to reproduce:
Compare output of
tests/testdata/linux-x86_64/oldbloaty.bin
on Linux and Mac.Linux:
Mac:
Note that mac binaries built on mac are unaffected.
Mac binaries (MachO) on linux, of course, can't be processed because bloaty uses otool to process MachO binaries.
The text was updated successfully, but these errors were encountered: