Problem with debugging.

Started by
3 comments, last by TheAdmiral 16 years, 11 months ago
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.
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
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..
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.

Everything is better with Metal.

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
Ring3 Circus - Diary of a programmer, journal of a hacker.

This topic is closed to new replies.

Advertisement