在emacs中查看函数的汇编代码

Viewing assembly code of functions in emacs

我想知道是否有一个 emacs 包可以让我快速查看函数生成的汇编代码?这也应该与启用的编译器优化一起使用。我想要的是能够用一个命令打开一个新缓冲区,其中将包含当前函数的汇编代码。

Xcode on OS X 做得很好,但我想在我的开发工作站上切换回 Linux 和 emacs,这是我的一个功能学会了很多喜欢。

尝试 disaster.el:

Disaster lets you press C-c d to see the compiled assembly code for the C/C++ file you're currently editing. It even jumps to and highlights the line of assembly corresponding to the line beneath your cursor.

It works by creating a .o file using make (if you have a Makefile) or the default system compiler. It then runs that file through objdump to generate the human-readable assembly.

disaster.elavailable in MELPA