Click here to Skip to main content
Click here to Skip to main content

Stepping in a specific method while debugging your code

By , 22 Jun 2012
 

Let's say you are debugging following line of code and you want to step into ProcessList method itself.

ProcessList(GetListOfStrings(), GetListOfInts());

Typically you will hit F11 (or Step Into option). That action will first take you in GetListOfStrings method. Since you do not want to debug this particular method you will simply step out of here. Then you hit F11 again which will take you in GetListOfInts method. Again, you really want to debug ProcessList method so once again you will step out from here as well. Now if you hit F11 again, this time it will take you in the right method ProcessList and you can debug the piece of code that you wanted to debug.

Rather than hitting F11 three times and steping out of these methods, you can right click when the first time you hit line of code where ProcessList method is called. If you look at available option in this context menu, one option is called "Step Into Specific". This option will also have sub-menus with all possible methods that could be invoked from this particular line. As show in figure below, all three methods ProcessList, GetListOfStrings and GetListOfInts are available here. If you choose ProcessList from this context sub-menu, it will take you directly in ProcessList method without stepping in and out of other two methods.

I hope you will find this tip helpful.

License

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

About the Author

Kamran Bilgrami
Architect
Canada Canada
Member
Kamran Bilgrami is a seasoned software developer with background in designing mission critical applications for carrier grade telecom networks. More recently he is involved in design & development of real-time biometric based security solutions. His areas of interest include .NET, software security, mathematical modeling and patterns.
 
He blogs regularly at http://WindowsDebugging.Wordpress.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5memberjohannesnestler26 Jun '12 - 2:00 
another good tip, I like it
GeneralThoughtsmemberPIEBALDconsult22 Jun '12 - 5:16 
0) This seems rather Visual Studio -specific, but you don't say so.
 
1) It doesn't seem to be C#-specific, but you include that in your tags.
 
2) Usually I just put a break point in the method.
 
3) You may want to expand it a bit and include some other VS debugging tips, like setting the next statement to execute.

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 22 Jun 2012
Article Copyright 2012 by Kamran Bilgrami
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid