Visual Studio 2005:出现值时中断
我正在尝试简化我的调试任务,并且我有一个可以提高调试速度的想法。 假设我有一个值,比如 2.8651,在代码中出现时我不知道。 我想知道是否可以创建一个超级断点,该断点将在其中一个变量第一次获取该值时停止。 我记得我不知道哪个变量取值。 我可以通过花一些时间在调试器上知道这一点,但我很懒。 我对 VS 的 VBA 不太熟悉。我想,一个解决方案是创建一个宏,该宏将在代码执行的每一行沿着局部变量循环。当条件 localVariable == 2.8651 得到验证时,它会停止。
谢谢您的回答!
I'm trying to simplify my debugging tasks and I had an idea which could increase my debugging speed.
Suppose I have a value, say 2.8651 that appear in the code at a moment I do not know.
I'm wondering if it was possible to create a super breakpoint which would stop at the first time one of the variable takes this value.
I recall that I do not know which variable takes the value.
I could know it by spending some time on the debugger but I'm lazy.
I'm not really familiar with VBA for VS. I guess, a solution would be to create a macro which would loop along local variable at each line of the code execution. It'd stop when the condition localVariable == 2.8651 is verified.
Thank you for your answers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
代码块不存在超级断点。有两个选项可以实现您想要的效果:
正如您所建议的,您可以通过右键单击断点并选择“点击时...”来放置带有宏的单个断点。但是,我非常怀疑是否可以从宏控制断点,所以这是行不通的。
There's no such thing as a super breakpoint for a block of code. There are two options to achieve what you want:
As you suggested, you can place a single breakpoint with a macro, by right-clicking the breakpoint and select When Hit.... However, I highly doubt that it's possible to control the breakpoint from the macro, so this wouldn't work.