Only Works in Debug

BlitzMax Forums/BlitzMax Programming/Only Works in Debug

MattVonFat(Posted 2006) [#1]
Hi,

What would be the common reasons for something to work perfectly in debug but not work outside debug?

Thanks,
Matthew


GfK(Posted 2006) [#2]
Nothing, really. File paths can be a fairly common problem.

Its difficult to say without any knowledge of any error messages you have, or what your code looks like, or where exactly its falling over.


Gabriel(Posted 2006) [#3]
Error checking is not done in release mode. So if you go out of bounds with arrays or pointers, that will show up in release mode, but probably get by without problems in debug.


GfK(Posted 2006) [#4]
Error checking is not done in release mode. So if you go out of bounds with arrays or pointers, that will show up in release mode, but probably get by without problems in debug.
...but 'array index out of bounds' errors and such show up in debug. You'd be more likely to get an error in debug mode and you could possibly get away with it in release mode.


Gabriel(Posted 2006) [#5]
Yeah, they should do, but sometime they won't. At least, so I've been told when I had a problem in debug and not in release.


GfK(Posted 2006) [#6]
At least, so I've been told when I had a problem in debug and not in release.
Yep, but Matt's problem is the other way around - works in debug, crash in release. Which is why I queried what you said. ;)


Gabriel(Posted 2006) [#7]
Sorry, typo. I meant that I had a problem in release and not debug. The recent problem I had with the XML module was fresh in my mind, but that's not the problem I was actually talking about.


H&K(Posted 2006) [#8]
You have ?Debug PreCompiler Directives that are pre-excluding bit of code that it shouldnt

Or as Gab implied, you might be catching out of bounds errors and fixing them, but these errors are not now being created in realese

Also, (And Im really not sure about this), but some of the defaults in the moduals are different in debug and realese. (I think that the default screen is windowed in debug, and fullscreen in release;- For example)


Dreamora(Posted 2006) [#9]
Another common problem is that loops are several times slower in debug so if you only do "short time tests" with debug you might never see them.
So when testing, test the whole game / app from beginning to end in debug and give the debug version to your testers as well (as long as you are a lazy programmer that does not use try catch to catch error instead of let them crash the app)


MattVonFat(Posted 2006) [#10]
Well I found out why I couldn't figure it out. The problem seems to be with SetGadgetText. I've tripple checked my code and I haven't entered the parameters wrong.

It's kinda wierd as I'm having alot of problems with SetGadget functions that relate to text.


FlameDuck(Posted 2006) [#11]
What would be the common reasons for something to work perfectly in debug but not work outside debug?
Main loop 'locals' going 'out-of-scope'.


Dreamora(Posted 2006) [#12]
Perhaps you try to set the GadgetText to a gadget not supporting that. (TextArea for example)


MattVonFat(Posted 2006) [#13]
I'm trying to set the text of a button.

It's weird as, rather than give an error, the program just ends.