如何在 WinDbg 中删除断点 ntdll!DbgBreakPoint+0x1

2024-03-05

我正在调试一个在将 WinDbg 设置为事后调试器时崩溃的程序。我在地址 77f7f571 设置了断点。当它被触发时,我常常得到以下信息:

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\System32\ntdll.dll - 
ntdll!DbgBreakPoint+0x1:

然后我按照以下指示进行操作http://www.osronline.com/ShowThread.cfm?link=178221 http://www.osronline.com/ShowThread.cfm?link=178221,现在我刚刚得到

ntdll!DbgBreakPoint+0x1:

我想删除这个断点,但无法列出或删除它。 bl、bc 或 bd 都没有输出:

0:002> bl 
0:002> bc * 
0:002> bd *

这不是基于行的断点,但看起来像是手动调用DebugBreak()就像下面的程序一样:

#include "stdafx.h"
#include "windows.h"    
int _tmain()
{
    DebugBreak();
    return 0;
} 

在内部,该方法将抛出异常。要控制 WinDbg 是否因异常而停止,请使用sxe bpe停止并sxi bpe忽略异常。

To try this, compile above application and run it under WinDbg (Ctrl+E). At the inital breakpoint, take over the control:

(1c2c.6a8): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=779d0000 edx=0020e218 esi=fffffffe edi=00000000
eip=773e12fb esp=0038f9e8 ebp=0038fa14 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!LdrpDoDebuggerBreak+0x2c:
773e12fb cc              int     3

0:000> sxe bpe; g
(1c2c.6a8): Break instruction exception - code 80000003 (first chance)
*** WARNING: Unable to verify checksum for DebugBreak.exe
eax=cccccccc ebx=7efde000 ecx=00000000 edx=00000001 esi=0038fd44 edi=0038fe10
eip=74d5322c esp=0038fd40 ebp=0038fe10 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000206
KERNELBASE!DebugBreak+0x2:
74d5322c cc              int     3

0:000> g
eax=00000000 ebx=00000000 ecx=00000000 edx=00000000 esi=77442100 edi=774420c0
eip=7735fd02 esp=0038fd78 ebp=0038fd94 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!ZwTerminateProcess+0x12:
7735fd02 83c404          add     esp,4

完成此实验后,输入.restart。然后重复实验sxi bpe:

(109c.1c1c): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=be9e0000 edx=0009e028 esi=fffffffe edi=00000000
eip=773e12fb esp=002ff890 ebp=002ff8bc iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!LdrpDoDebuggerBreak+0x2c:
773e12fb cc              int     3

0:000> sxi bpe; g
eax=00000000 ebx=00000000 ecx=00000000 edx=00000000 esi=77442100 edi=774420c0
eip=7735fd02 esp=002ffc20 ebp=002ffc3c iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!ZwTerminateProcess+0x12:
7735fd02 83c404          add     esp,4

正如你所看到的,WinDbg 并没有停留在KERNELBASE!DebugBreak+0x2由于异常不再发生。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 WinDbg 中删除断点 ntdll!DbgBreakPoint+0x1 的相关文章

随机推荐