View Full Version : Can you Debug in REAL time, while the program is running ?
06-10-2002, 02:22 PM
Ok Im almost done with collision detection between my Camera and Walls . However, I made small change, bud don't know where in my program that corrupts my Collision data.. When I position my camera Near the Wall, and Run Debug, the collision detects intersection, and sends collision Flag.. However in my Program after 1st collision, for some reason I can go through walls . .I was wondering If it is possible to run the program ( you know Key interaction, moving my camera ) while at the same time looking at the Debug Data, trying to pin point the mistake ?????????
Is this even Possible ?
06-10-2002, 02:31 PM
To an extent, depending on your development environment. What are you packing?
06-10-2002, 02:46 PM
Im using VC++ 6.0... In my program I have interactions with the keyboard. While debugging in VC++, I can't use my program, only can see what whether collision happens or not, from my Defaul camera values .. I would like to run my program, and try to see a after which function my data gets corrupted, while changing Position of the camera..
I know the program is good, because it Run perfectly when I only had 1 wall .. Then I decided to add 3 crating Rectangular inclusion... My Idea was to crate couple of Structures, linked together to the main Structure which would define the Individual Wall..
This way I could just crate Linked structures, and then Easily assign coordinates for 4 walls, and using the same Function compute Cross Product, Vectors, Normalize etc .....
And its works, but somewhere I made a BOOBOO, and I don't see where.
06-10-2002, 04:23 PM
Just a thought... can you use asserts or conditional breakpoints to try and trap your error? Sometimes these are the best tools to find mistakes like these.
You could also put a breakpoint on the memory address that is getting corrupted, and then when it changes your program will break. To do this, go to the breakpoints menu (ctrl-b I think) and go to the data tab and type in the memory address
> Is this even Possible ?
If you can run your program in windowed mode, I know you can debug this sort of thing with the gnu tools (under, say, Linux) quite nicely.
The way it works there is; you open up a terminal window and run your program from there. printf()'s get printed out to the window from where you ran the program (as usual).
Then you open up a 2nd terminal window and run gdb from there -- you run gdb in such a way as to attach to the already-running process (which you've got paused perhaps, or maybe just looping or waiting for input).
Dunno how you'd do this sort of thing from VC++.
06-11-2002, 08:40 AM
Or in unix you could just print the address of your variable:
printf("var:%0x\n", (int) &var);
Then in another program open /proc/pid (where pid is your process id)
-fseek to the address printed.
I know there is an analogue to this in windows where you can open the process space, but I have not done it.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.