Advertisement

Debug/Release builds not providing correct output

Started by June 17, 2001 07:44 AM
6 comments, last by python_regious 23 years, 7 months ago
Hey all, I have a problem that I have been trying to resolve for a while now, but to no avail, and so I turn to you lot with your infinate wisdom in hope that you can help. My problem comes when building my game in release mode, everything is screwed, parts of strings are missing, or are just in the wrong place, colours are wrong, bits have been added where they shouldn't have been etc etc etc. All of this is correct in Debug, but not in Release, to help I have taken 2 screenshots, one in Debug ( how it's supposed to look ) and one in Release ( all screwed ). Debug: Release: I am using OpenGL as the renderer. I hope someone can help, perhaps someone had the same problem? Regards, Phil. Edited by - python_regious on June 17, 2001 8:46:32 AM
If at first you don't succeed, redefine success.
Could easily be uninitialized variables. Are you getting any warnings?
Advertisement
also make sure you''re using "assert" with anything crucial in the case--the entire statement gets compiled-out for release mode.

Try compile in debug mode (optimizations off) with the _DEBUG flag turned off and the NDEBUG flag turned on--should produce very similar code to your release mode.

If all else fails, you can turn on program database information in release mode and debug the program--the problem is that most of your internal variable will be missing or reporting incorrect addresses when you try to debug because of optimizations. Good luck.
In debug mode, the compiler often allocates more memory for your arrays and such, in case you overextend their boundaries. If your code is "proper", ie no stray pointers, no sloppy character string manipulations, all memory accounted for etc etc, then there shouldn''t be any difference.
I would also guess uninitialized variables as a probable culprit here. Release mode, as opposed to debug mode, won''t automatically zero memory allocated to arrays and such, so make sure you are manually initializing anything along those lines, and not taking anything for granted.

-Ironblayde
 Aeon Software

"My car gets forty rods to the hogshead, and that''s the way I likes it!" - Grandpa Simpson
"Your superior intellect is no match for our puny weapons!"
Keep in mind that debug mode for MSVC actually pattern-fills memory, not zero-fills it. Uninitialized memory gets 0xCDCDCDCD, and the areas before and after memory blocks are filled with another pattern (this is checked when the memory is freed--if it''s been altered, you get the "damage before/after block" message). It also fills memory when you delete it with an entirely different pattern, and uninitialized stack variables should also be set to a pattern. Nothing should be zero-filled in debug mode.
Advertisement
Thanks for all your help, it''s going to take a while to sort out, as I have 10000 lines of code to sort through Thanks for all your help though....
Well, I have managed to sort alot of it out, and was primarily to do with not zeroing out memory, thanks for all your help.
If at first you don't succeed, redefine success.

This topic is closed to new replies.

Advertisement