Results 1 to 8 of 8

Thread: Can you Debug in REAL time, while the program is running ?

  1. #1
    Member Contributor
    Join Date
    Apr 2002
    Location
    brooklyn, ny
    Posts
    65

    Can you Debug in REAL time, while the program is running ?

    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 ?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Eastern USA
    Posts
    218

    Re: Can you Debug in REAL time, while the program is running ?

    To an extent, depending on your development environment. What are you packing?

  3. #3
    Member Contributor
    Join Date
    Apr 2002
    Location
    brooklyn, ny
    Posts
    65

    Re: Can you Debug in REAL time, while the program is running ?

    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..

    Ex

    Wall[0].info.CrossPvector.x
    or
    Wall[2].coordinates[3].x

    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.

  4. #4
    Member Contributor
    Join Date
    Oct 2001
    Posts
    67

    Re: Can you Debug in REAL time, while the program is running ?

    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.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    417

    Re: Can you Debug in REAL time, while the program is running ?

    One word:

    printf()



  6. #6
    Guest

    Re: Can you Debug in REAL time, while the program is running ?

    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

  7. #7
    Senior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    east norwalk, ct, usa
    Posts
    184

    Re: Can you Debug in REAL time, while the program is running ?

    > 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++.

  8. #8
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    Re: Can you Debug in REAL time, while the program is running ?

    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.
    -read(&var, sizeof(var),...)
    printf var

    I know there is an analogue to this in windows where you can open the process space, but I have not done it.

Similar Threads

  1. Replies: 7
    Last Post: 12-13-2011, 04:43 AM
  2. Measuring GLSL shader program running time
    By awhig in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 07-19-2009, 09:40 AM
  3. Is this real-time?
    By glfreak in forum OpenGL: General
    Replies: 5
    Last Post: 12-13-2007, 05:46 PM
  4. real-time FUR.
    By DSA in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-19-2004, 12:51 PM
  5. Real-Time
    By ZeeBoy in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-19-2001, 03:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean