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
Select “Break at Function“
Give the Function Name and Click on OK. The below screen will appear:
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.
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.
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.
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
Filed under:
Debugging,
Tips and Tricks,
Visual Studio 2010