[英]What's the best way to view accurate disassembly in VC++ 2010 while in Win32 Release mode?
I am writing assembly-level optimized code, and I need to make sure that the C++ compiler is working with it correctly in Release-Mode. 我正在编写程序集级别的优化代码,并且需要确保C ++编译器可以在Release-Mode下正确使用它。
I used to be able to get Release-Mode programs to break on breakpoints in VS 2002 (and display the raw disassembly as I stepped through it), but I can't remember how I got that to work. 我曾经能够在VS 2002中使发布模式程序在断点处中断(并在逐步执行时显示原始反汇编),但是我不记得我是如何工作的。 Does VS 2010 have any options that might allow this to happen?
VS 2010是否有任何可能允许这种情况发生的选项?
用于发布版本(/ Zi)的构建符号[编辑:并与/ DEBUG链接],您将能够设置断点。
如果要使用调试器查看反汇编,则可以在要查看的代码之前放置一个__debugbreak()内部调用。
If you're writing straight assembly, you can just use INT 3
. 如果要编写直线汇编,则只需使用
INT 3
。 When you place a breakpoint using the debugger, it actually changes the code to that (0xCC in binary) so the debugger will get called when it's executed. 使用调试器放置断点时,它实际上会将代码更改为该断点(二进制为0xCC),因此调试器在执行时将被调用。
You can also call one of the functions that do that for you like zr suggested. 您也可以像zr建议的那样调用为您执行此操作的功能之一。 The Windows one is DbgBreakPoint() .
Windows是DbgBreakPoint() 。 If you disassemble it, you could easily see it's nothing but
INT 3
. 如果拆开它,您很容易就能看到它只有
INT 3
。
These used to be methods of causing breakponts: 这些曾经是导致断头的方法:
_asm
{
int 3
}
or 要么
_asm
{
_emit 0xcc
}
or was it 还是
_emit 0xcc
I'm not sure of the syntax (it's been a while) but hopefully something can be made of it. 我不确定语法(已经有一段时间了),但希望可以使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.