调试器进入breakmode时的代码 [英] Code when debugger enters breakmode

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

问题描述

我有一个大型进程,运行了几个小时我调试。有什么方法可以让我知道什么时候发生了什么,例如当程序因任何原因进入休息模式时:断点,抛出异常?我知道当
达到一个断点时我可以附加到VS的声音,但这还不够好。我希望在它发生时运行一些代码,以便我可以让我的手机尖叫或其他什么。


提前致谢。

解决方案

您可以在TracePoint表达式中执行自己的代码。  我意识到表达式旨在返回要显示的文本,但是您可以将该表达式调用为您自己的函数,然后可以执行您想要的任何操作。


断点> ;当命中...>打印信息>的 {MakePhoneScream()}


I have a large process that runs for hours that I debug. Is there a way to let me know when something happens, for example when the program enters break mode for whatever reason: Breakpoint, thrown exception? I know about the sound I can attach to VS when it hits a break point, but that's not good enough. I would like to run some code when it happens so that I can make my phone scream or whatever.

Thanks in advance.

解决方案

You can execute your own code in a TracePoint expression.  I realize the expression is intended to return text for you to display, but you can make that expression call your own function which can, in turn, do whatever you want.

Breakpoint > When Hit ... > Print a message > {MakePhoneScream()}


这篇关于调试器进入breakmode时的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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