Macro debugger

VSScript features a simple integrated debugger. It allows you to debug your macros. The following buttons on the toolbar are applicable to the debugger:

Start debugging Click to start debugging the macro currently selected in the editor.
Break execution Click to interrupt execution of running macro during debugging session.
Continue execution Click to continue interrupted macro.
Step into Click to step to the next line of code, or into the function call.
Step over Click to step to the next line of code, skipping any function call.
Step out Click to step out of currently executed function.
Stop debugging Click to end the debugging session.


In order to create or remove a beakpoint, click on the editor window margin. This works quite the same as for other programming languages.

Examining the call stack and execution threads

During debugging session, the Package and Current script selection boxes are given a different meaning. The first one now selects execution thread. Lua offers a coroutine model which is a form of cooperative multithreading. If you use coroutines, you will be able to select current thread (for call stack view) with the first box. The second one selects particular frame within the thread.

Viewing contents of the variables

In order to examine the contents of a variable when the macro is stopped, just hover the mouse over the variable name inside the editor window. You can also select an expression inside the editor by dragging the mouse. If the expression is correct and can be evaluated, VSScript will display its value. The value is determnined in the context of currently selected stack frame.

For subsequent version of VSScript, more options for looking inside the interpreter state (including table contents) is planned.

Table of Contents

Copyright (C) 2012-2015 Soft-Erg. All rights reserved.