windbg的系统异常状态设置

sx显示系统异常设置状态, 如下
0:001> sx
  ct - Create thread - ignore 创建线程
  et - Exit thread - ignore  退出线程
 cpr - Create process - ignore 创建进程
 epr - Exit process - break 退出进程
  ld - Load module - output 加载模块
  ud - Unload module - ignore 卸载模块
 ser - System error - ignore 系统错误
 ibp - Initial breakpoint - break 初始化断点
 iml - Initial module load - ignore 初始化模块加载
 out - Debuggee output - output  调试输出


  av - Access violation - break - not handled 非法访问内存
asrt - Assertion failure - break - not handled assert报错
 aph - Application hang - break - not handled 程序被挂起
 bpe - Break instruction exception - break 断点异常
bpec - Break instruction exception continue - handled 同上
  eh - C++ EH exception - second-chance break - not handledC++ EH 异常
 clr - CLR exception - second-chance break - not handled公共语言运行时异常
clrn - CLR notification exception - second-chance break - handled 公共语言运行时通知异常
 cce - Control-Break exception - break 控制台程序中按下CTRL+C 或者  CTRL+BREAK
  cc - Control-Break exception continue - handled 同上
 cce - Control-C exception - break 同上
  cc - Control-C exception continue - handled 同上
  dm - Data misaligned - break - not handled 数据未对齐
dbce - Debugger command exception - ignore - handled 指定调试器命令异常
  gp - Guard page violation - break - not handled  非法访问页
  ii - Illegal instruction - second-chance break - not handled 非法指命
  ip - In-page I/O error - break - not handled 页中的字节i/o错误
  dz - Integer divide-by-zero - break - not handled 除0错误
 iov - Integer overflow - break - not handled 整数溢出
  ch - Invalid handle - break 非法句柄
  hc - Invalid handle continue - not handled 同上
 lsq - Invalid lock sequence - break - not handled 非法锁住队列
 isc - Invalid system call - break - not handled 非法的系统调用
  3c - Port disconnected - second-chance break - not handled 端口断开
 svh - Service hang - break - not handled 服务挂起了
 sse - Single step exception - break 单步异常
ssec - Single step exception continue - handled 同上
 sbo - Stack buffer overflow - break - not handled 栈缓存溢出
 sov - Stack overflow - break - not handled 栈溢出
  vs - Verifier stop - break - not handled 被校验器停止
vcpp - Visual C++ exception - ignore - handled Visual C++ exception异常
 wkd - Wake debugger - break - not handled 唤醒调试器
 wob - WOW64 breakpoint - break - handled WOW64 断点
 wos - WOW64 single step exception - break - handled WOW64 单步断点


   * - Other exception - second-chance break - not handled 其它异常


其中呢,上面有些选项是需要记一下下的,如下:

SXE or -xe

Break

(Enabled)

When this exception occurs, the target immediately breaks into the debugger. This break in occurs before any other error handlers are activated. This method is calledfirst-chance handling.

SXD or -xd

Second chance break

(Disabled)

The debugger does not break in for this kind of first-chance exception (although a message is displayed). If other error handlers cannot address this exception, execution stops and the target breaks into the debugger. This method is calledsecond-chance handling.

SXN or -xn

Output

(Notify)

When this exception occurs, the target application does not break into the debugger at all. However, a message is displayed that informs the user of this exception.

SXI or -xi

Ignore

When this exception occurs, the target application does not break into the debugger, and no message is displayed.


另外,关于 “handle”标志,如果标志上了handle标志后,说明此异常已经被处理过了,后继的异常处理就不用处理了;如果是标志为not handle时,则程序会继续寻找下一个异常处理者来处理异常,但是,也有可能到最后都没有找到异常处理者,于是调试器就有第二次处理异常的机会了,名曰: second-chance handling,可以通过SXD来设置的。

举例:
>>sxn epr:此命令可以将响应退出线程的动作变为output,而不是前面输出的break,也就是说,被调试线程退出时不再会触发中断了。

其实,上面通过命令来设置快是快,不过对我这种记性不好的人,还是比较喜欢点窗口的。
在windbg中,点Debug/Event Filter即可弹出设置窗口的~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 下载安装WindbgWindbg是微软官方提供的调试工具,可以在微软官网上下载。 2. 打开Dump文件:在Windbg菜单栏中选择“File”->“Open Crash Dump”,选择要分析的Dump文件。 3. 加载符号:在菜单栏中选择“File”->“Symbol File Path”,添加符号文件路径,以便Windbg能够正确解析代码。 4. 分析Dump文件:在Windbg中输入“!analyze -v”命令,分析Dump文件。Windbg会输出Dump文件的分析结果,包括错误代码、异常信息等。 5. 查看堆栈:在Windbg中输入“kb”命令,查看当前线程的堆栈信息。堆栈信息可以帮助我们定位到出现问题的代码位置。 6. 查看变量值:在Windbg中输入“dv”命令,查看当前线程中的变量值。通过查看变量值,可以帮助我们了解程序运行状态,定位问题。 7. 分析调用栈:在Windbg中输入“!analyze -v -hang”命令,分析系统卡慢的原因。Windbg会输出系统卡慢的原因,帮助我们找到问题。 8. 分析内存泄漏:在Windbg中输入“!heap -s”命令,分析应用程序中的内存泄漏。Windbg会输出应用程序中的内存泄漏情况,帮助我们优化应用程序。 9. 分析CPU使用率:在Windbg中输入“!runaway”命令,分析CPU使用率。Windbg会输出CPU使用率高的线程信息,帮助我们找到CPU使用率高的原因。 10. 分析网络问题:在Windbg中输入“!netstat”命令,分析网络问题。Windbg会输出网络连接信息,帮助我们找到网络问题的原因。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值