Yogesh Jagota's Personal Blog
small c# code snippets and free code libraries

Debugging: Setting breakpoint options

Tuesday, 26 February 2008 01:50 by Yogesh Jagota

I have came across many people who are programming using Visual Studio but still do not know that there are many debugging options exist. Mostly these people are new to programming, but I have also seen veterans who are uninformed about this life saving feature of Visual Studio. So I thought I should write about the feature.

You can set a breakpoint by clicking at the extreme left strip of your text editor or press the shortcut F9 key. After a breakpoint is se, you just right click the breakpoint marker of the strip and you are presented with many options, which are:

Location shows the point where the current breakpoint is set. It shows current file, line number and character position. The option "Allow the source code..." allows you keep stepping even if you make changes to the source code.

 

Condition allows you to make the breakpoint hit only if a certain condition is hit. In this example, we can make the breakpoint hit when i is equal to 9 making the breakpoint skip the first 8 times when it is reached.

 

Hit Count allows you to make the breakpoint hit only at a given reached count or after a number of times it has been reached.

Filter allows you to make the breakpoint hit only when it is reached inside a particular process or thread.

When Breakpoint Is Hit option can be described as a post-breakpoint-hit-action type of option. It allows you to set one or more actions to execute when a breakpoint is hit.

Although I assume most people will know this, if even some people learn anything from this I am happy that I shared this because when I myself started programming using Visual Studio, I did not knew about this option for a long time, almost two months and I wondered how to stop the execution only when the value of x is y. Glad that I did found about it sooner than later.

Del.icio.usDigg It!DZone It!kick it on DotNetKicks.com
Tags:  
Categories:   Visual Studio
Actions:   E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Comments

Add comment


 

biuquote
Loading