检测调试器何时附加 [英] Detect when a debugger attaches

查看:65
本文介绍了检测调试器何时附加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CLR甚至Win32是否提供调试器附加到进程时触发的任何类型的事件或中断?我知道运行代码可以检查是否附加了on但是不确定是否有任何通知机制来检测何时附上一个

Does the CLR or even Win32 provide any kind of event or interrupt that's triggered when a debugger attaches to a process? I know that running code can check to see if on is attached but not sure if there's any notification mechanism for detecting when one attaches.

Thx

推荐答案

嗨Korporal Kernel,

Hi Korporal Kernel,

感谢您在此发帖。

如果你想要一个调试器附加到进程时触发的某种事件或中断,你可以使用

Debugger.Break方法
。 

If you want some kind of event or interrupt that's triggered when a debugger attached to a process, you could use Debugger.Break Method


如果连接了调试器,调试器会通过用户断点事件发出信号,并且调试器会暂停执行
,就像调试器断点一样已被击中。


这篇关于检测调试器何时附加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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