Showing posts from April, 2011

Visual Studio Macro to Break on Every Method in File

While tracking down the source of certain features (read bugs) within overly complex applications, I have sometimes found it useful to break on every call to every method within a file.

The functionality to "Break on Every Method" is not built into Visual Studio, but it is possible to set up the necessary break points through a macro.  I did not originally write this macro, but while trying to find it again at a recent job I couldn't, so I decided to post it here for safe keeping.  It is fairly primitive, but it gets the job done.  Simply place the cursor within the file you are working with right before the first method you want to break on.  The macro will then search through the file for each opening brace "{" and place a break point at each one.  Hope it helps someone.

To "install" this macro simply open up your macro explorer, edit a module and paste this macro/method in.  If you do not have any macros you will need to record an empty macro first…