Jump to content

the stack


xtreampb
 Share

Recommended Posts

I'm trying to do some debugging. When my code goes to the "un-handled exception, press break to debug" message box, it takes me to the utility and vector source code. I know that the bug is in my code, not these classes. So i'm asking how do i use the stack to debug my code. I know i can see what function threw the error, but does it give me any more information like args passed to it? I've never had to use the stack before now so i'm in-experienced in using it to debug software.

 

Thanks

 

~Xtreampb~

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

In Visual Studio the call stack shows you the chain of functions. If you dbl click it'll bring you to said function (normally look for the last of your functions and go there). Then you can mouse over variables to see what's up. Generally this is all I need to tell me why I got the error.

  • Upvote 1
Link to comment
Share on other sites

However, quite often it happens that the same code runs differently in debug and release mode, and either the error occurs only in debug mode, or only in release mode. Then it's impossible to debug the program, except with printf(); statements until you find the line which causes the error.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

i know it has something to do with my collisions. When my object collides it is destroyed. What i think is happening is it is colliding a second time and it hasn't been destroyed from the first collision. so it tries to destroy it the second time but there is nothing to destroy.

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...