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 :( |
| ||
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.. |
| ||
Its the green circle marked "continue". |
| ||
![]() 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 |
| ||
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? |
| ||
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 |
| ||
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. |