Jump to content
  • Advertisement
Sign in to follow this  
ahayweh

Real-time debugging...

This topic is 4351 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

Hey all, I was wondering what a common, and effective way of real-time game debugging. Using the step-through debugger that ships w/VC++ doesn't really seems to be very well suited ( lots of crashes ). Can anyone reccomend a program ( or method ) they used other that via an in-game console? Thanks, ahayweh

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ahayweh
Hey all,

I was wondering what a common, and effective way of real-time game debugging. Using the step-through debugger that ships w/VC++ doesn't really seems to be very well suited ( lots of crashes ). Can anyone reccomend a program ( or method ) they used other that via an in-game console? Thanks,

ahayweh

Crashes? Can you elaborate a bit more on that? I've never experienced the VC++ debugger crashing (GDB, now that's a different matter... [grin])

Sure you're not just doing something wrong?

Share this post


Link to post
Share on other sites
depends on what you're debugging:

crashes -> step through debugger

odd behavior:
1) print stuff to the screen so you can watch the numbers change and get an idea of whats going on
2a) set a conditional breakpoint now that you know what happens to the numbers
2b) try to intuit what's going on..

Either way, you almost always end up in a debugger.

-me

Share this post


Link to post
Share on other sites
I'd like to ask you a question, if you press ctrl + f5 (run without debugging) does your program run without crashing? If not, then it's not the debugger that's crashing, and someone here will be able to help you.

Share this post


Link to post
Share on other sites
Hey,

My mistake, its the program that crashing ( or hanging in some thread ), not the debugger. Right now I am doing some threading programming, and it's pretty error prone... I guess what I am looking for, is for some way to be able to look at the output of the game and still be able to use the debugger as normal...

Share this post


Link to post
Share on other sites
Yeah erbez,

Running it normal, it works fine. It's just when I try switch back and from between running the app and debugging, that the problem occurs. Could it be something to do with cooperation levels or priorties?

Share this post


Link to post
Share on other sites
Try "OutputDebugString", this is helpful in multi-threaded apps because you can see the order thngs are done in. Also, does not slow things down *too* much. You can use "dbgview" or the debugger to view output.

Share this post


Link to post
Share on other sites
it sounds like you want to be able to step through the code in the debugger as the real-time application is running.

There isn't really an easy way to do that. The easiest and least expensive option is to have the application run in windowed mode. Next you could try adding another monitor. And last you could remote debugging from another machine, but this is usually a very costly option since you need a second machine and the enterprise edition of visual studio to do it.

Share this post


Link to post
Share on other sites
Quote:
Original post by ahayweh
Running it normal, it works fine. It's just when I try switch back and from between running the app and debugging, that the problem occurs. Could it be something to do with cooperation levels or priorties?

Multithreaded code which changes behaviour when you attach a debugger is usually a sign of a race condition somewhere.

Share this post


Link to post
Share on other sites
If you are using Visual Studio, I recommend you look up "trace points." They're like a combination of break points and OutputDebugString()/printf()/et cetera -- they allow you to pump a message into the debugger's output window at a specified point during execution, but they do not require you to recompile your code, which is very useful for a lot of reasons.

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!