简体   繁体   English

在NetBeans中将C ++代码输出为汇编语言

[英]Output C++ code as assembly language in netbeans

I've looked around other threads for the answer. 我已经在其他线程周围寻找了答案。 But none of them have really broken down what needs to be done in the ide to view the assembly output. 但是它们都没有真正分解需要查看组装输出的想法。

Try these after compiling your project: 编译项目后尝试以下方法:

  • UNIX UNIX系统

objdump -d a.out objdump -d a.out

  • Windows 视窗

dumpbin /DISASM a.exe dumpbin / DISASM a.exe

Yes, NetBeans can show you an assembly code. 是的,NetBeans可以向您显示一个汇编代码。 For that you need: 为此,您需要:

  • Compile your program with -g flag -g标志编译程序
  • Open your source in Editor window and set a breakpoint (for example, on the main function) 在“ Editor窗口中打开源代码并设置断点(例如,在main函数上)
  • Start debugger by clicking Debug Project button or just hitting Ctrl-F5 通过单击“ Debug Project按钮或仅Ctrl-F5启动调试器
  • Open disassembly window by clicking Window -> Debugging -> Disassembly button, which becomes clickable only after you start the debugger 通过单击“ Window -> Debugging -> Disassembly按钮来打开反汇编窗口,只有在启动调试器后,该按钮才可单击

The NetBeans will open a new window with assembly code next to the Editor window with C++ source. NetBeans将在带有C ++源代码的“ Editor窗口旁边打开一个带有汇编代码的新窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM