top of page
Search
Writer's pictureIvaylo Fiziev

Changing block state in SCL debugger


When debugging scripts you may want to alter the state of a variable to see the effect it has on the code. Until v2408 this was only possible if you have a signal connected to the variable. This however implies that only input/output variables can be changed at runtime. In the debugger all you could do is observe the state of the variables once you hit a breakpoint.

Now we are modifying the 'commands' tool to support runtime changes. Basically you can execute individual statements in order to modify the state of the script and observe the effect at the same time. Much like the 'immediate' window in any other debugger. It's like adding extra code to your script without modifying it.


To make the difference: Earlier versions had the commands tool as well but it was only capable of evaluating expressions. Statements are the real use case for it but it was not there yet. Now statements are indeed the usual suspect when you type. If you need expressions then prefix them with a question mark. Much like a query. What's the value of...?

On the negative side of things both statements and expressions should fit on a single line. e.g. they should be simple. This however is the expected way to use this feature. After all the aim is not to redesign the script but do slight modifications. Any statement that you execute will run in the context of the current stack frame (the active function in the call stack). On success the 'OK' confirmation will appear on the next line. If there is a syntax error you'll be notified accordingly. How about semantic errors? These are reported as 'No result'.

No fancy stuff here. Just a useful feature.

17 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page