Page 1 of 3

Run-time debugger in Blackbox Component Builder

Posted: Mon Nov 21, 2016 3:05 pm
by rangel
I am new to BlackBox Component Builder (http://blackboxframework.org/). I am experienced in Pascal, Delphi, C, C++... but I am currently in the processes of understanding the differences between these "standard" languages and Component Pascal. Tutorials are being very helpful.

One question that I have is the presence (or absence) of a runtime debugger. I tend to find breakpoints very useful to track bugs and develop code. However, I could not find how to set breakpoints in BlackBox Component Builder. In fact, I do not even know if this is possible. I searched the Documentation, Tutorials and the web, but I could not find how to stop the execution of the code at a given point, and check the current value of variables.

Is there a runtime debugger in BlackBox Component Builder? Is it possible to set breakpoints in the code execution?

Thanks in advance!

Re: Run-time debugger in Blackbox Component Builder

Posted: Mon Nov 21, 2016 3:16 pm
by Ivan Denisov
Usually I am using HALT(0) for that purpose. The TRAP window gives you navigation for the current value of variables.

Re: Run-time debugger in Blackbox Component Builder

Posted: Mon Nov 21, 2016 10:43 pm
by rangel
Thanks for the prompt answer, Ivan.

Upon your suggestion, I have tested the HALT(0). It should work for what I need. Is there a way to proceed with code execution after the halt command?

On a following question... As I understand how BlackBox works, every time I change the code of a module, I must re-compile it. For the compilation, the CTRL+K shortcut comes very handy. However, I have noticed that I must also unload the previous version of the model, through the menu Dev > Unload. Then, I must select a line with a Module.Procedure command, and execute it through the menu Dev > Execute.

I wonder if I am taking a long route (Compile + Unload + Selection + Execution), and if there is a shortcut to execute a recently updated/changed code. What are the steps that you use to test the code that you are currently developing (and changing).

Again, thanks in advance!

Re: Run-time debugger in Blackbox Component Builder

Posted: Tue Nov 22, 2016 8:22 am
by X512
rangel wrote:Is there a way to proceed with code execution after the halt command?
No, at least without using unsafe tricks.
There is debugger DevRemDebug, that supports breakpoints and step by step execution.
rangel wrote:On a following question... As I understand how BlackBox works, every time I change the code of a module, I must re-compile it. For the compilation, the CTRL+K shortcut comes very handy. However, I have noticed that I must also unload the previous version of the model, through the menu Dev > Unload. Then, I must select a line with a Module.Procedure command, and execute it through the menu Dev > Execute.

I wonder if I am taking a long route (Compile + Unload + Selection + Execution), and if there is a shortcut to execute a recently updated/changed code. What are the steps that you use to test the code that you are currently developing (and changing).
It is possible to compile and unload module with single shortcut Alt, D, A (all keys should be pressed sequentially). In Windows you can execute any menu command by pressing Alt and underlined letter key.

Re: Run-time debugger in Blackbox Component Builder

Posted: Tue Nov 22, 2016 8:30 am
by X512
Some another useful shortcuts:
Alt, D, D: unload selected modules (one or more).
Alt, I, S: open selected module object (like Views.View) source.
Alt, I, D: open selected module object documentation.
Alt, I, O: show log.
Alt, I, C: clear log.
Alt, I, G: show selected module global variables.

Re: Run-time debugger in Blackbox Component Builder

Posted: Tue Nov 22, 2016 3:52 pm
by Ivan Denisov
rangel wrote:On a following question... As I understand how BlackBox works, every time I change the code of a module, I must re-compile it. For the compilation, the CTRL+K shortcut comes very handy. However, I have noticed that I must also unload the previous version of the model, through the menu Dev > Unload. Then, I must select a line with a Module.Procedure command, and execute it through the menu Dev > Execute.

I wonder if I am taking a long route (Compile + Unload + Selection + Execution), and if there is a shortcut to execute a recently updated/changed code. What are the steps that you use to test the code that you are currently developing (and changing).
It is easier to use Commanders to unload and run procedures. To learn how to use commanders please read ObxHello0 documentation file.

To insert commander call Tools -> Insert commander. Use Ctrl+Commander click to unload module and run. Just Click commander to execute command after it.

To unload several modules use command ^Q DevDebug.UnloadThis MyMod1 MyMod2 MyMod3 etc. The modules should be on the reverse order of importing each other.
(^Q - is commander), you should click it to run all the command.

Also you can setup the default fonts for BlackBox in Edit -> Preferences dialog.

Re: Run-time debugger in Blackbox Component Builder

Posted: Thu Nov 24, 2016 2:20 pm
by rangel
X512 wrote:There is debugger DevRemDebug, that supports breakpoints and step by step execution.
Thanks for the answer X512.

I searched for this debugger, but could not find it online. Could you, please, provide a link or reference?

Thanks!

Re: Run-time debugger in Blackbox Component Builder

Posted: Sat Feb 04, 2017 6:45 pm
by Romiras
rangel wrote:
X512 wrote:There is debugger DevRemDebug, that supports breakpoints and step by step execution.
Thanks for the answer X512.

I searched for this debugger, but could not find it online. Could you, please, provide a link or reference?

Thanks!
You can get it from here: https://github.com/romiras/BlackBox-Com ... emDebug.cp (branch feature/linref-dev-tools). This branch is extraction from "linref" distribution: https://bitbucket.org/petryxa/linref/src

Re: Run-time debugger in Blackbox Component Builder

Posted: Mon Feb 06, 2017 10:52 am
by Josef Templ
Does this debugger work reliably?
Is it in a shape such that it could be included in the
center distribution?

Any known bugs or limitations?
Anything like a docu?

- Josef

Re: Run-time debugger in Blackbox Component Builder

Posted: Tue Feb 07, 2017 6:56 am
by Zinn
Single step is very nice but I don't miss it. There is something else which is much more helpful for debugging:

Syntax highlighting

See Go SSA HTML view at the website https://pauladamsmith.com/blog/2016/08/go-1.7-ssa.html
To get a feeling about what I'm talking move down to the line
main
Help
start
and look at the animation there.

- Helmut