Jump to content
  • Advertisement
Sign in to follow this  
Vanz

Debugging help please...

This topic is 3440 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sometimes when running my program when I'm in debug mode and my program stops at a debug point, then I click on the VC++2008 editor my program crashes. It never crashes when I run the .exe, anyone else get this? It does not happen at any specific time or in the same place in my program. Any ideas on how to debug it... Is there a good way to debug if an array is called outside it's range i.e. int temp[5]; temp[5]=1; Also, is there a decent way to debug if when using Bitblt, you accidently blit outside of the screen area, i.e. if screen size is 1900x1200 BitBlt(hdc, 1800, 0, 200, 0, hdcMap, 0, 0, SRCCOPY); These are the type of bugs I routinely find (but with many variables changing) and could be still in my program but would take way too long to go through every iteration and combination to ensure it won't happen manually... any ideas on how to find these type or other "common" bugs would be appreciated... I have precautions all over the place to ensure it doesn't happen, but in the end it still does - must be when I'm really tired... i.e. ScreenWidth=1900; if (a>ScreenWidth) a=ScreenWidth; Thanks for any ideas/suggestions... rhuala

Share this post


Link to post
Share on other sites
Advertisement
- Sounds like warped memory but that's a new one for me.

- Use a std::vector or std::tr1::array
[edit] I should clarify... if you go outside of the range, the program will either break on assertion or throw an exception to let you know what happened. [/edit]

- You could wrap BitBlt, do some assertions in the wrapper so it breaks to the code if you're outside the bounds, and "replace all" your current BitBlts to the new wrapped version... call it BitBltChecked or something. This would allow you to change how it handles going outside the clipping area in one single place, as well as many other advantages.

Cheers
-Scott

[Edited by - popsoftheyear on January 23, 2009 3:32:35 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!