Set a Breakpoint on a Function

Keyboard:  CTRL + B
Menu:  Debug -> New Breakpoint -> Break at Function
Command:  Debug.BreakatFunction
Versions:  2008,2010
Published:  4/30/2010
Code:  vstipDebug0020

"Normal" breakpoints are based on line and character position:

image

image

But what if you don't want to break on a specific line but instead break when you hit a particular function?  No problem!  There are three ways to do this:

One

Right-Click a function name and go to Breakpoint -> Insert Breakpoint

image

Two

In the Breakpoints Window, Click on the New button and choose "Break at Function" to bring up the New Breakpoint dialog.

image

Three

Press CTRL + B to bring up the New Breakpoint dialog.

New Breakpoint Dialog

image

 

Options Two and Three will take you to the New Breakpoint dialog.  Here you can type in the name of the function you want to break at then click OK.  Using any of these methods you will see something similar to the following when you are done:

image 

 

And there you have it!  Setting a breakpoint on a function.