调试在Visual Studio 2010中的所有事件,而不设置断点 [英] Debugging all events in Visual Studio 2010 without setting break points

查看:256
本文介绍了调试在Visual Studio 2010中的所有事件,而不设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想调试其中有大量事件的Windows窗体应用程序:按下按钮,计时器等。

I am trying to debug a windows form application which has a large number of events: button presses, timers, etc..

有没有办法赶上每

编辑:
程序不是我写的,所以我不熟悉代码。我想步执行整个程序,捕捉每行代码被执行。作为各种控制动态创建的每一个事件设置断点是不切实际的。

edit: The program was not written by me, so I am unfamiliar with the code. I wish to step through the entire program, catching every line of code being executed. Setting break points in every event is impractical as various controls are created dynamically.

推荐答案

有关调试一个按钮,点击不设置断点:

For debugging a button click without setting breakpoints:


  1. 与调试器启动应用程序。

  2. 立即预定点击之前获取的状态。

  3. 返回到调试器按暂停,然后F11(步入) - 什么都不会发生

  4. 进入应用程序,并按下按钮。 - 调试器应接管拖放到你的事件处理程序

  1. Start the app with the debugger.
  2. Get to the state immediately before the intended click.
  3. Go back to the debugger and press Pause then F11 (Step Into) -- nothing will happen.
  4. Go to the app and press the button -- the debugger should take over and drop you into the event handler.

请注意:如果油漆,任何鼠标事件,或者可能是一些其他事件的处理这将无法工作。调试器将下降到这些处理程序尝试上述步骤的任何时间。

Note: This will not work if Paint, any Mouse event, or probably some other events are handled. The debugger will drop you into those handlers any time you attempt the steps above.

这篇关于调试在Visual Studio 2010中的所有事件,而不设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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