DebugStop

BlitzMax Forums/BlitzMax Programming/DebugStop

ImaginaryHuman(Posted 2009) [#1]
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?


Gabriel(Posted 2009) [#2]
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.


xMicky(Posted 2009) [#3]
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)


Brucey(Posted 2009) [#4]
...you cannot continue again running program in a non-step-mode


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


TaskMaster(Posted 2009) [#5]
Yes you can. I always do that.

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


xMicky(Posted 2009) [#6]
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.


ImaginaryHuman(Posted 2009) [#7]
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.


Czar Flavius(Posted 2009) [#8]
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..


Yan(Posted 2009) [#9]
You haven't been using debug mode at all, IH?

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


ImaginaryHuman(Posted 2009) [#10]
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 ;-)


Czar Flavius(Posted 2009) [#11]
I don't know whether I pity you or admire you the most ;)


Perturbatio(Posted 2009) [#12]
I knew about it, but I don't recall ever using it.


GfK(Posted 2009) [#13]
Oh. My. God. (or any other deity).

How can you do anything without using the debugger?


ImaginaryHuman(Posted 2009) [#14]
I usually add lots of print statements around problem areas and then recompile over and over and over again ;-)


Mahan(Posted 2009) [#15]
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.


Perturbatio(Posted 2009) [#16]
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.


Brucey(Posted 2009) [#17]
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)


Czar Flavius(Posted 2009) [#18]
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 :(


pete03(Posted 2011) [#19]
So where is the Play/Run button? I have looked but no joy..

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


GfK(Posted 2011) [#20]
Its the green circle marked "continue".


col(Posted 2011) [#21]


This pic is taken when the debugger has stopped execution using the standard editor that comes with BMax.

From left to right :
The rocket icon is the Build icon
The Green dot is the Continue icon to continue execution.
Next icon will Step through the code skipping over functions ( still executing them ).
Next is the Step In icon that will step into functions.
After that one is the Step Out icon, This allows to step out of loops and functions.
The last ( the red dot ) is the Stop icon to stop execution and return to editing code.

Last edited 2011


pete03(Posted 2011) [#22]
Thanks but. I dont get a green button - I am still left with the Build and Run - Rocket taking off icon. Any idea about that?


col(Posted 2011) [#23]
Nope,
Not if your program is executing and you have a DebugStop in your and the program has stopped at that instruction then you should see the icons above.

You should only have the rocket taking off icon when you are editing your code.

If you see the rocket taking off icon while your code is running, you could try re-installing the editor??

Last edited 2011


GfK(Posted 2011) [#24]
Um... are you using Blitz3D or Blitzplus by any chance?

Also, there's seriously no need to post three times about the exact same thing - we've got this thread, another thread, and you started on about it in the annotated Blitzmax manual as well.

Keeping it to just one place preserves my sanity. What little there is of it left.