Skip to main content
GameDev.net gamedev.net
🔒 Locked

Real-time debugging...

Started by ahayweh Sep 20, 2006 at 7:11 PM 9 replies 1.7k views
Original Post
ahayweh
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
Spoonbender
Spoonbender
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?
Palidine
Palidine
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
Ezbez
Ezbez
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.
ahayweh
ahayweh
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...
ahayweh
ahayweh
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?
ChookMaster
ChookMaster
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.
jkleinecke
jkleinecke
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.
-----------------------------------Indium Studios, Inc.
OrangyTang
OrangyTang
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.
jpetrie
jpetrie
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.
ahayweh
ahayweh
Kool every1,

Thanks for the input. That tracepoints route seems like a good direction to go in. Back to coding.

peace,
ahayweh

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.