Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging all events in Visual Studio 2010 without setting break points

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

Is there a way to catch every line of code being executed by the application without setting a break point?

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.

like image 739
Ying Chan Avatar asked Oct 20 '10 13:10

Ying Chan


People also ask

How do I skip breakpoints in Visual Studio?

You can disable all breakpoints in one of the following ways: On the Debug menu, click Disable All Breakpoints. On the toolbar of the Breakpoints window, click the Disable All Breakpoints button.

How do I fix breakpoint in Visual Studio?

Hover over the breakpoint symbol, choose the Settings icon, and then select Remove breakpoint once hit in the Breakpoint Settings window.

How do you see all breakpoints in VS?

There is a window called Breakpoints window and after opening that you can see all the breakpoints in the application. To open the breakpoints window: Go to menu Bar > Debug > Windows > Breakpoints click. Or press Ctrl+Alt+B.


1 Answers

For debugging a button click without setting breakpoints:

  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.

like image 81
Austin Salonen Avatar answered Sep 18 '22 15:09

Austin Salonen