|
The Watch |
Top Previous Next |
The watch is a facility which allows you to inspect and change the current value of variables and object properties. You can only use this facility when you are in debug mode and when the program execution is stopped. TIDE is unable to fetch variable values while the Virtual Machine is running. Depending on the scope of the variable, there may be additional limitations as to when you can inspect this variable's value.
The watch updates variable values by reading them from the target every time the Virtual Machine is stopped. If any item on the list changed its value since the previous fetch, this item will be displayed in red.
Watch facility may be accessed by three different ways:
The Watch Pane
The watch can be toggled by View > Watch. It looks like this:

Here, we can see the status of a short, a char, a string, a real, a property of an object, one user-defined structure, and an undefined variable. Notice, that the "realval" variable is displayed in red indicating that its value has just changed.
|
There are several ways of adding variables and object properties to the watch list. You can:
|
In the Add to Watch List dialog you may type multiple items to be added to the watch by separating their names with commas (i.e. "i, j, k, ser.num").
|
At the moment, TIDE offers limited support for watching arrays. You can only add the whole array to the watch. That is, if you have an array arr1, you can add entire arr1 to the watch and see all of its members, but you cannot add specific element of this array to the watch, like arr1(2). This limitation will be removed in the future releases of TIDE. |
Double-clicking the Name column will allow you to edit the name of the item you want to watch.
The watch pane also allows you to change the value of any variable or object property (provided it is not a read-only property). Double-click on the value field - you will be prompted for a new value.
For numerical variables, you may use hex or binary notation (&h, &b). For strings, you will be presented with the "modify string value" dialog allowing you to either type in the characters or input their ASCII codes in HEX notation.
Upper textbox of the dialog displays escape sequences instead of unprintable characters. For example, character with code 10 (&hA, LF) will be displayed as "\n". When editing the string you can input any character, even a printable one, using an appropriate escape sequence. You can also input ASCII characters with codes 0 ... 26 (&h1A) with CTRL+A ... CTRL+Z keystrokes.
Lower textbox allows direct editing of ASCII character codes.

|
When in the upper textbox of this dialog, use CTRL+INS and SHIFT+INS for copy/paste. This is because the standard CTRL+C and CTRL+V will be understood as keystrokes for entering ASCII characters (see above)! |
Once a new value is entered, it will be actually written to memory on the target, and will be read again before being displayed in the watch. So when you see your new value in the value column, that means it's actually in memory now -- what you see is what you get.
The watch pane is one of the places where enumeration types become very useful. Look at sys.runmode above. Because its possible values are described through an enum, you can see a meaningful state description, rather than just a number. This is one of the main reasons for the existence of enumeration types in Tibbo Basic.
|
To remove a variable from the watch, select it and press Delete, select Debug > Remove from Watch List or click the Remove from Watch List button on the Debug toolbar. |
The Watch Tooltip
This is the watch tooltip:

When you hover the mouse cursor over an identifier in the source while in debug mode you will see a tooltip with the current value for this identifier.
|
For now, this won't work for arrays. If you want to inspect the values of an array add this array to the watch list. |
The Project Browser

The Project Browser is a tab in the Project pane, which can be toggled by View > Project. It displays all objects for your platform, with the properties and methods for each object. It also displays all procedures and global variables in your project.
While debugging, you can see the value of an object property or a global variable by hovering over its identifier in the tree.