Click here to Skip to main content
15,882,152 members
Articles / Visual Studio

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

Rate me:
Please Sign up or sign in to vote.
4.86/5 (3 votes)
22 Dec 2010CPOL2 min read 38.6K   2   2
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)


Written By
Technical Lead
India India
.NET Consultant | Former Microsoft MVP - ASP.NET | CodeProject MVP, Mentor, Insiders| Technology Evangelist | Author | Speaker | Geek | Blogger | Husband

Blog : http://abhijitjana.net
Web Site : http://dailydotnettips.com
Twitter : @AbhijitJana
My Kinect Book : Kinect for Windows SDK Programming Guide

Comments and Discussions

 
QuestionCan't set breakpoint for all methods in a class for C#. Pin
humayoun kabir9-Sep-13 22:50
professionalhumayoun kabir9-Sep-13 22:50 
GeneralMy vote of 5 Pin
Brij23-Dec-10 8:15
mentorBrij23-Dec-10 8:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.