简体   繁体   English

在Win32 Release模式下在VC ++ 2010中查看准确的反汇编的最佳方法是什么?

[英]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.

相关问题 如何在vc++ win32 api中控制滚动条 - how to control scrollbar in vc++ win32 api 如何在vc ++ win32中制作可滚动窗口 - how to make a scrollable window in vc++ win32 如何在VC ++ Win32应用程序中打印鼠标坐标? - How to print mouse coordinates in VC++ Win32 application? 程序VC ++ Win32应用程序中的错误? - Error in Program VC++ Win32 application? 在Win32中验证SSL证书的正确方法是什么? - What's the correct way to verify an SSL certificate in Win32? VC ++ win32 API编程:如何从剪贴板中获取图像并将其显示在Windows中? - VC++ win32 API programming: how can I get the image out of the clipboard and display it in a windows? 如何在代码块的特定win32异常类型上禁用VC ++破坏? - How can I disable VC++ breaking on a specific win32 exception type for a block of code? 如何使用WIN32核心和VC ++将位图图像拉伸到某些特定的Co Ordinates? - How to stretch a bitmap image to some specific Co Ordinates using WIN32 core and VC++? 如何在VC++ Win32应用程序中鼠标光标位置打印句子? - How to print sentence in the position of the mouse cursor in VC++ Win32 application? 是否可以在 Windows 8 环境下运行在 Visual Studio 2005 上编译的 VC++、Win32 应用程序? - Is it possible to run VC++, Win32 application compiled on Visual Studio 2005 on Windows 8 environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM