Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Visual-Studio

Tips: Set Breakpoint to multiple Functions at the same time in Visual Studio

4.86/5 (3 votes)
22 Dec 2010CPOL2 min read 39.3K  
In this post, I am going to share two quick tips by which you can set breakpoints to functions very easily.

Visual Studio has great features to set breakpoints in multiple functions at the same time. Most of the time, to set a breakpoint within a function, you just put a breakpoint in the first line of the function. Now, assume you have 10 different overloaded methods or you have the same function in different projects, and you want to put a breakpoint in all of them or a few of them, then it will take time to put a breakpoint in each and every function. In this post, I am going to share two quick tips by which you can set breakpoints to functions very easily. The first one is by using “Break at Function” and the second one by “Using Find Combo Box”.

Tip 1: Using Break at Function

You can use break at function window from Breakpoint Window where you can give the function name. It will automatically show you all the function names that are matching with the name and will put the breakpoint.

Debug > Window > Break Point

image

Select “Break at Function“

image

Give the Function Name and Click on OK. The below screen will appear:

image

Where it will show you all the function names and from where you can select the function where you want to put the break point or select All if you want to put breakpoints to all of your functions.

image

Now, you may think, what about multiple projects, yes, this will work for multiple projects as well. If you have multiple methods with the same name in a different project, it will retrieve all of them and will put the breakpoint on the selected method.

image

Note: You have to make sure that in the function break point window, you have checked “Use Intellisense to verify the function name” because based on that, Visual Studio will select the functions.

Now here is the second and interesting tip.

Tip 2: Use Find Combo Box

You can use the find combo box for the similar purpose that I have described earlier. But this is very easy and interesting. What you need to do is to put the function name at Find Combo box and Press F9. :)

image

Summary: In this post, I have shared two of the easiest ways to deal with breakpoints in function. Hope this will help you.

Thanks !

AJ
Shout it


Filed under: Debugging, Tips and Tricks, Visual Studio 2010

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)