Run-time debugger in Blackbox Component Builder

Usage of the framework, compiler and tools
rangel
Posts: 3
Joined: Mon Nov 21, 2016 3:00 pm

Run-time debugger in Blackbox Component Builder

Post 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!
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Run-time debugger in Blackbox Component Builder

Post by Ivan Denisov »

Usually I am using HALT(0) for that purpose. The TRAP window gives you navigation for the current value of variables.
rangel
Posts: 3
Joined: Mon Nov 21, 2016 3:00 pm

Re: Run-time debugger in Blackbox Component Builder

Post 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!
X512
Posts: 72
Joined: Sat Feb 07, 2015 2:51 pm

Re: Run-time debugger in Blackbox Component Builder

Post 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.
X512
Posts: 72
Joined: Sat Feb 07, 2015 2:51 pm

Re: Run-time debugger in Blackbox Component Builder

Post 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.
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Run-time debugger in Blackbox Component Builder

Post 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.
rangel
Posts: 3
Joined: Mon Nov 21, 2016 3:00 pm

Re: Run-time debugger in Blackbox Component Builder

Post 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!
Romiras
Posts: 35
Joined: Tue Sep 17, 2013 5:55 am
Location: Tel-Aviv

Re: Run-time debugger in Blackbox Component Builder

Post 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
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Run-time debugger in Blackbox Component Builder

Post 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
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: Run-time debugger in Blackbox Component Builder

Post 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
Post Reply