如何禁用程序断点/断言? [英] How to disable a programmatical breakpoint / assert?

查看:191
本文介绍了如何禁用程序断点/断言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio开发本机应用程序,我在使用__asm int 3或__debugbreak放置的代码中有一个程序断点(assert)。有时,当我打它时,我想禁用它,以便在同一个调试会话中的连续命中不再进入调试器。如何做到这一点?

解决方案

x86 / x64



<您正在编写x86 / x64应用程序,在您的监视窗口中写下:



x86: *(char *)eip,x



x64: *(char *)rip,x



您应该看到一个值0xcc,它是INT的操作码。将其替换为0x90,这是NOP的操作码。您也可以使用eip作为地址的内存窗口。



PPC



假设您正在编写PPC应用程序(例如Xbox 360),在您的监视窗口中写下:



*(int *)iar,x / p>

你应该看到一个值0xfeNNNNNN,它是陷阱的操作码(最常见的是0x0fe00016 =无条件陷阱)。替换为0x60000000,这是NOP的操作码。


I am using Visual Studio, developing a native application, I have a programmatical breakpoint (assert) in my code placed using __asm int 3 or __debugbreak. Sometimes when I hit it, I would like to disable it so that successive hits in the same debugging session no longer break into the debugger. How can I do this?

解决方案

x86 / x64

Assuming you are writing x86/x64 application, write following in your watch window:

x86: *(char *)eip,x

x64: *(char *)rip,x

You should see a value 0xcc, which is opcode for INT 3. Replace it with 0x90, which is opcode for NOP. You can also use the memory window with eip as an address.

PPC

Assuming you are writing PPC application (e.g. Xbox 360), write following in your watch window:

*(int *)iar,x

You should see a value 0xfeNNNNNN, which is opcode for trap (most often 0x0fe00016 = unconditional trap). Replace it with 0x60000000, which is opcode for NOP.

这篇关于如何禁用程序断点/断言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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