DebugStop

BlitzMax Forums/BlitzMax Programming/DebugStop

This is funny, but in the past few years that I've been using BlitzMax I never knew the IDE had the capability of stepping through a program a line at a time showing the contents of variables and data structures. I tried the command `DebugStop` yesterday and was happily surprised, and laughing at myself, to see it doing exactly that - just what I needed! This is cool.

Can someone explain what the `step in` and `step out` do, though? Step out seems to continue processing until the next DebugStop?

If you're stepping through and the next line to be executed is a function call, Step In will take you into that function instead of stepping over to the next line after function returns. Step out will take you back out again to wherever the current function was called from.

It may be then that your happyness reduces a little bit when you discover, that, after program have had a "Debugstop", you cannot continue again running program in a non-step-mode ;)
Well, at last me bothers this fact (you can do that with other programming languages, for example with Visual Basic)

...you cannot continue again running program in a non-step-mode


Yes you can. You just hit Play/Run again... and off it goes...

Yes you can. I always do that.

Edit: Damn, Brucey always on the quickdraw...

Thx, now I am happily surprised too !

I think I made different experiences earlier...until BMax 1.30 debugmode didn't work well on my Notebook and also crashed the IDE randomly.

Cool. I also didn't realize that when you've compiled in debug mode and you don't even use DebugStop, and it hits some kind of error like you go outside array bounds or something, it dumps you into the editor but with the debugger active, so you can continue stepping through and resume later. I never knew you could do that either!

More reasons to love BlitzMax.

Hehe I'm suprised when people don't know about these tools, I couldn't live without them! Tutorials and things should definately dedicate at least one chapter to them. It's a fairly standard thing for most mainstream languages..

You haven't been using debug mode at all, IH?

Blimey, your either a master coder or a masochist. ;o)

Erm, no, I never have. I always assumed debug was just so that when you did something wrong at runtime, like outside the array bounds, it would tell you that you did so and then show you which line the problem occurred on. I thought that, itself, was the system's attempt to `debug`, ie look here, this is where the problem is. I never knew you could then start stepping through and looking at variables and such. I've been roughing it all this time ;-)

I don't know whether I pity you or admire you the most ;)

I knew about it, but I don't recall ever using it.

Oh. My. God. (or any other deity).

How can you do anything without using the debugger?

I usually add lots of print statements around problem areas and then recompile over and over and over again ;-)

I'm kinda startled too at this. I was a little grumpy about the DebugStop in BlitzMax in the first place as most other languages/IDE's just turn on/off breakpoints at runtime at any line you like. But living without any debugger at all its ... well it's very 70'ies of you =)

I think it was Borland that introduced on-the-fly debugging (at least for PC) in Turbo C 2.0 (around 1984-1986 something) so it's quite an aged feature nowadays.

How can you do anything without using the debugger?


I think i've been a web programmer too long, I'm too used to not having a debugger at all. I know you can use things like the Zend debugger for PHP, but I've never gotten around to trying it.

I used to use Delphi's one all the time.

As a side-effect of my recent remote-debugging work, I've managed to implement on-the-fly debugging. This is where you remove the DebugStop, and can break the app at any time, subsequently restarting it when you want.

Thinking about what Mahan says about "breakpoints" I can see how it might be possible to add that kind of functionality too. (toggle a line on/off as a breakpoint, and when the app reaches it... bang)

Perturbatio, my number 1 gripe with web languages is the lack of debugger! I once lost all my work because I put a debugging alert in a Javascript for loop which got stuck, and I had to end process the browser :(