Run-time debugger in Blackbox Component Builder

Usage of the framework, compiler and tools

Run-time debugger in Blackbox Component Builder

Postby rangel » Mon Nov 21, 2016 3:05 pm

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

Re: Run-time debugger in Blackbox Component Builder

Postby Ivan Denisov » Mon Nov 21, 2016 3:16 pm

Usually I am using HALT(0) for that purpose. The TRAP window gives you navigation for the current value of variables.
User avatar
Ivan Denisov
 
Posts: 265
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Run-time debugger in Blackbox Component Builder

Postby rangel » Mon Nov 21, 2016 10:43 pm

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

Re: Run-time debugger in Blackbox Component Builder

Postby X512 » Tue Nov 22, 2016 8:22 am

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: 37
Joined: Sat Feb 07, 2015 2:51 pm

Re: Run-time debugger in Blackbox Component Builder

Postby X512 » Tue Nov 22, 2016 8:30 am

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

Re: Run-time debugger in Blackbox Component Builder

Postby Ivan Denisov » Tue Nov 22, 2016 3:52 pm

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

Re: Run-time debugger in Blackbox Component Builder

Postby rangel » Thu Nov 24, 2016 2:20 pm

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

Re: Run-time debugger in Blackbox Component Builder

Postby Romiras » Sat Feb 04, 2017 6:45 pm

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

Re: Run-time debugger in Blackbox Component Builder

Postby Josef Templ » Mon Feb 06, 2017 10:52 am

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

Re: Run-time debugger in Blackbox Component Builder

Postby Zinn » Tue Feb 07, 2017 6:56 am

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
Zinn
 
Posts: 73
Joined: Mon Nov 24, 2014 10:47 am

Next

Return to Common questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron