Jump to content
  • Advertisement
Sign in to follow this  
Cybrosys

[.net] Different debugging methods

This topic is 4416 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was curious about different debugging methods, and by debugging i don't mean stepping through your code. I was more interrested in what built-in features there are in .net and vs that allows me to print out debug messages in different ways without having to create a class of my own for debugging. [Edited by - Cybrosys on June 14, 2006 8:49:22 AM]

Share this post


Link to post
Share on other sites
Advertisement
VS2005 actually added some support for exactly what you're describing. However, it isn't in the Express edition for C# or VB. It is in C++ express, if that's what you're using, as well as (I believe) Standard Edition and higher.

These are called tracepoints. To use them, you can right click on the red circle for a breakpoint you have set. If you are using the appropriate version of VS, you'll get a context menu with several options. These allow you to set things like hitcount (how many times the BP must be hit before breaking,) condition (some expression that must be true for the bp to be hit,) and an option called "When Hit..." It's this last one that you want - it allows you to set a breakpoint that doesn't break, but rather outputs some text.

If you don't have that version of VS, or you want to do it from your code rather than the IDE, take a look at the System.Diagnostics.Debug class. System.Diagnostics.Debug.Write will output some text to the output window in Visual Studio (or whatever debug listener is registered.)

Hope that helps.

Share this post


Link to post
Share on other sites
Tracepoints are heaven when you need to debug UI focus issues, like I have this past week.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!