Inspecting, Watching, and Modifying Script Data

Some of the most common software bugs occur because a variable does not hold the correct value at a key point in the program. That can happen for a variety of reasons:

The variable was not initialized.
The variable was not updated.
An incorrect value was assigned to the variable.

The repercussions of these kinds of errors can be enormous and varied. For example, if parts of a script are executed only when a variable is set to a specific value, your installation will be incomplete if that controlling variable is set incorrectly. If the variable is used to control a while loop, that loop may never be executed, or it may execute forever, hanging the installation.

To fully analyze a bug, you must be able to investigate the value of script data as you trace through the script. The InstallScript Debugger provides you with three ways to do so:

1. Inspect a variable to determine its current value. At any breakpoint or while stepping through the script, you can check the value of any global variable in the script. When the execution point is within a user-defined function, you can also check any variables that are local to that function.
2. Watch a variable to observe any changes in its value as you use the Step In and Step Over commands to trace script execution. The control window includes a watch window that lets you insert one or more variables that you want to monitor in your debugging session.
3. Change the value of a variable at a key point in the program to test your theories about the role of that variable in the bug that you are analyzing or to override the effects of a logic error that you discovered in your script.