Disassemble the executable created by g++ in mac osx

◇◆丶佛笑我妖孽 提交于 2019-12-06 04:27:45
Tony Delroy

It's not exactly what you're asking for, but g++ -S produces assembly from source code and can be expected to be more readable than a disassembled version.

If you can't recompile with -S (e.g. no source code), then gdb lets you disassemble, as does objdump --disassemble. Depends what you've installed.

See also: https://superuser.com/questions/206547/how-can-i-install-objdump-on-mac-os-x

Brett Hale

Look at otool. i.e., otool -tv a.out

Edit: To add to Tony's answer, objdump also has name demangling for C++, i.e.,

objdump -tC a.out (IIRC)

I gave a previous answer on how to build and install the binutils for darwin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!