Skip to main content
gamedev.net
🔒 Locked

Debugging question

Started by The C modest god Aug 30, 2005 at 1:24 PM 3 replies 400+ views
Original Post
The C modest god
The C modest god
I have found a bug of an infinite loop in my code. So I fixed it. However, what bothers me is that when I did go in debug mode and then did break. The call stack showed that I was in KERNEL and INPUT8 instead inside the problematic loop. Why does that happen? Is it because of the alt tabbing to go to visual and do the break? Why this happen?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
Anon Mike
Anon Mike
Need to see some code. Knowing your OS and debugger would help too.
-Mike
CTar
CTar
It's probably because those functions are called from the infine loop, imagine:

void Draw(){    SetMatrices();}void SetMatrices(){    VectorStuff();    VectorToMatrix();}void VectorStuff(){}void VectorToMatrix(){}int main(){    while(true)    {        Draw();    }    return 0; }


When you break you might be in VectorToMatrix since the calls go like this;
main->Draw->SetMatrices->VectorToMatrix
You should be able to "jump" down and see what is happening in the main loop by using the callstack, for example if it looks like this:
VectorToMatrix
SetMatrices
Draw
main

You should be able to double-click main and know you are in the loop. At least this is how it works in MSVC7.1
The C modest god
The C modest god
No, the callstack does not contain any of my code, in any upper level.
I don't have now this code because I did major modifications.
I guess this will remain a mystery
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
mattnewport
mattnewport
You probably broke into the wrong thread. Go to the 'threads' debugger window and you can choose which thread you wish to view the callstack for.

Topic Locked

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

Sign in to reply to this topic.