Celedev Blog Archive

Old posts that were originally published on celedev.com

Celedev CodeFlow has now been renamed Bounces.

Some posts in this section may be outdated or not relevant anymore.
Please refer to the Home page and the Documentation section for current information about Bounces.

CodeFlow 0.9.10 improves debug features


It has been almost two weeks since I released CodeFlow 0.9.10 and it is more than time for me to write a few words about the changes in this version.

CodeFlow v0.9.10, that can be downloaded here, is mostly focused on improving the debug experience when developing code in Lua.

The Lua Command Editor can now interpret commands in the context of the currently-selected call-stack frame. This means that the Command Editor can execute virtually any sequence of Lua code, that would be valid at the current line of the selected call-stack function. Executed code has read / write access to all variables visible at the current source location: this includes local variables, up-values, var-args and free names (i.e. Lua env-aware globals).

CodeFlow also features an improved Variables Inspector that displays more information about the current state of your program: it allows the visualization of masked local variables, and the display of custom Lua environments. In addition, the Variables Inspector now includes a simple type-aware variable editing capability, and other small improvements that make it easier to use and very reliable.

I will illustrate these debug features with a simple screenshot of a test program:

CodeFlow 0.9.10 new debug features

Here the execution is stopped at line 23 in a function named square, where a lot of variable masking takes place.

Variables Inspector

To start with, the function defines a local environment on line 12, that masks the inherited _ENV up-value (that was set at line 4); you can see in the Variable Inspector that the masked _ENV up-value is dimmed but still accessible, and you can easily identify the active _ENV, which is a local variable.

In addition, many variables in the square function are named x. This is really confusing and certainly not a good programming practice, but this is still syntacticly-valid Lua code. Fortunately, the CodeFlow Variable Inspector will help you to clarify things.

The last x in the list is not dimmed, so it is the active variable x; its value has been modified by the last step in the code, as indicated by the yellow highlight on the Craig value. Other variables called x are dimmed, so they are masked; you can locate any them precisely in the source code by selecting it in the variable inspector, like here thexwith value Bob: we can see that it is set on line 21 and never read.

Lua Commands

Now, we can have a look at the Lua Command Editor, in the Lua Console pane. The Lua Console title indicates the context in which the command will be executed, here in function square, line 23. The code of the command is colored appropriately for this context, so it is easier to detect typing errors: you can see that huge and print are colored as up-values, and x is colored as a local variable, which is precisely what we expect.

What happens if we execute the command?

CodeFlow 0.9.10 new debug features

We can see that the values of variables huge and x have been modified (highlighted in yellow), and the console output contains the string printed by the command, with the right value for x.

Other improvements

In addition to these debug-related improvements, CodeFlow v0.9.10 fixes a number of bugs in various parts of the system and improves the reliability of the connection between CodeFlow and target iOS device running the application.

Post a Comment


Recent posts

Blog Post
Aug 1, 2016

CodeFlow 1.0.2

CodeFlow 1.0.2 is a minor release that focuses on improving the Live Application Developer's Experience.

Aug 1, 2016
Blog Post
Jun 16, 2016

CodeFlow 1.0.1 and WWDC 2016

The just-released CodeFlow 1.0.1 brings support for the new iOS 10, tvOS 10 and macOS 10.12 announced at WWDC 2016 this week.

Jun 16, 2016
Blog Post
Jun 9, 2016

CodeFlow turns 1.0

It has been some time since the last beta of CodeFlow, version 0.9.20 was released in January this year. And all this time, we have worked very hard to improve CodeFlow, and to turn it into an effective Application Development System that we love to…

Jun 9, 2016
Blog Post
Apr 22, 2016

Live storyboards in CodeFlow

Live storyboards are a important feature of the upcoming CodeFlow 1.0. Mixing the power of Xcode storyboards with the flexibility of CodeFlow live coding, they are amazing for fast, fun and creative live app development.

Apr 22, 2016