Debugging question

Recommended Posts

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?

Share this post

Share on other sites
Need to see some code. Knowing your OS and debugger would help too.

Share this post

Share on other sites
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

Share this post

Share on other sites
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

Share this post

Share on other sites
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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

• Forum Statistics

• Total Topics
627735
• Total Posts
2978854

• 10
• 10
• 21
• 14
• 12