Jump to content
  • Advertisement
Sign in to follow this  
Kobaltic

Problem with debugging.

This topic is 4232 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

I am using c++ 2005 express. My game crashes on a level load. I decided to try and use debug to help out. The problem is when I attach the game to debug the game runs fine and doesn't crash. As soon as I play the game without the debug it crashes. Any ideas on what could cause this or something I should look at.

Share this post


Link to post
Share on other sites
Advertisement
When the game crashes the compiler should set you to a point where the error occurred, it should also give you an error code that may help you decipher what the problem is. What also may help pinpoint the exact error is break points. You can set a break point right before the area where the game crashes. Then Step In/Out of the code. This link kinda describes some debug features in VC 2005

Share this post


Link to post
Share on other sites
Finally caught the crash. I had to use a different level. So here is the error I got. I have no idea on what it is or how to figure out my problem.

First-chance exception at 0x7c812a5b in Myprogram.exe: Microsoft C++ exception: CL_EXCEPCION_FINAL_FUNCION at memory location 0x0012efc6..

Share this post


Link to post
Share on other sites
that memory location looks dubious. It's not 4 byte aligned for starter which could be what the exception is about.

So, memory corruption, something like that. Something specific to your game probably. Look at the callstack and see what it was trying to do.

Share this post


Link to post
Share on other sites
Quote:
Original post by oliii
that memory location looks dubious. It's not 4 byte aligned for starter which could be what the exception is about.

So, memory corruption, something like that.

Actually, no. x86 machine code isn't usually dword-aligned. Instructions are contiguous and may be anywhere from one to fifteen bytes in length.

Under Windows XP SP2, 7C812A5B is executable code inside kernel32!RaiseException. In fact it's the return value upon SYSENTER. Put simply, this is the address at which the debug event will trigger whenever API-code (or user-code) throws an exception.

By the looks of things, CL_EXCEPTION_FINAL_FUNCTION is a user-defined Microsoft C++ exception. Are you using any external libraries that are likely to define their own exceptions?

A common cause of applications behaving differently under the debugger is the execution path. Under the project settings dialog, it is possible to set the directory from which the executable is to run. This setting is ignored if the file is launched from Windows Explorer. Do you have sufficient error-handling installed for the resource-loading routines? If the application is running from the wrong directory and can't find some of its files, it may be compelled to throw an exception just like this.

Admiral

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!