如何查看使用Visual C ++中的code后面的组装? [英] How to view the assembly behind the code using Visual C++?

查看:155
本文介绍了如何查看使用Visual C ++中的code后面的组装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在读有关的code两条线的效率另外一个问题,和运说,他期待在code背后的装配和两行均装配相同。题外话不谈,我怎么能查看程序编译时创建的组件code。

I was reading another question pertaining the efficiency of two lines of code, and the OP said that he looked at the assembly behind the code and both lines were identical in assembly. Digression aside, how could I view the assembly code created when a program is compiled.

我使用微软的Visual C ++,但我也想知道,如果有可能,查看后面Visual Basic编写的code的组装。

I'm using Microsoft's Visual C++, but I would also like to know if it's possible to view the assembly behind code written in Visual Basic.

所以,我怎么查看组装code编写的高级语言如C ++和Visual Basic程序的后面?

So, how do I view the assembly code behind a program written in higher level languages like C++ and Visual Basic?

推荐答案

有几种方法:


  1. 您可以看到正常组装code,而在Visual Studio调试C ++(和eclipse太)。对于这种在Visual Studio中放一个断点code有问题,当调试器到达它分辩点击,找到转到大会(或preSS CTRL + ALT + D)

  1. You can normally see assembly code while debugging C++ in visual studio (and eclipse too). For this in Visual Studio put a breakpoint on code in question and when debugger hits it rigth click and find "Go To Assembly" ( or press CTRL+ALT+D )

第二种方法是生成汇编清单在编译时。对于此去项目设置 - > C / C ++ - >输出文件 - > ASM列表位置和文件名填写。还可以选择集结号输出到集结号带有源$ C ​​$ C。

Second approach is to generate assembly listings while compiling. For this go to project settings -> C/C++ -> Output Files -> ASM List Location and fill in file name. Also select "Assembly Output" to "Assembly With Source Code".

编译程序并且使用任何第三方的调试器。您可以使用OllyDbg的或WinDbg的这一点。你也可以使用IDA(交互式反汇编)。但是,这是做这件事的核心方式。

Compile the program and use any third-party debugger. You can use OllyDbg or WinDbg for this. Also you can use IDA (interactive disassembler). But this is hardcore way of doing it.

这篇关于如何查看使用Visual C ++中的code后面的组装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆