DebugStop() stopped working !?

BlitzMax Forums/BlitzMax Programming/DebugStop() stopped working !?

skn3(Posted 2012) [#1]
Ok I have an incredibly weird issue... after months of coding on my project and probably near 100,000 lines of code DebugStop() has stopped working in certain situations. I have tried it in blide and MaxIDE and the debugger "starts" but doesn't halt execution.

Now I can't reproduce this error or provide source code here (doh!) so I guess I am asking if anyone has any experience with this happening and what things it could be, what I could look for ?

Last edited 2012


AltanilConard(Posted 2012) [#2]
weird.. do you have debug build enabled? (just checking)


matibee(Posted 2012) [#3]
Are you using MaxGUI? I've found I can't step through my maxgui project but I've never tried stepping through one before.


skn3(Posted 2012) [#4]
hehe yeah had debug enabled. Also heavily using maxgui!

I tracked it down to me throwing a lua_error which is destroying the stack somehow? I havn't fixed it, well its fixed if i don't call lua_error ... but I need to call that so I guess a day of hair pulling is ahead of me :)


skn3(Posted 2012) [#5]
Well I found a solution, If I wrap my lua_pcall code in a try/catch block it at least protects the stack. No exception is being reported but it solves the issue :) ... hopefully?


ziggy(Posted 2012) [#6]
Isn't this a bug?


Noobody(Posted 2012) [#7]
lua_error:
Generates a Lua error. The error message (which can actually be a Lua value of any type) must be on the stack top. This function does a long jump, and therefore never returns.

I highly doubt longjmp-ing works well together with BMax (it doesn't even work in C++, where destructors won't get called).