Chapter 5. Controlling Process Execution

This chapter tells you how to control process execution in CASEVision. It includes the following topics:

Main View Control Panel

Process execution is controlled using the top portion of the Main View window. See Figure 5-1.

Figure 5-1. Main View Control Panel

Figure 5-1 Main View Control Panel

The Main View window contains a row of execution control buttons that enable you to control program execution. The execution control buttons are located above the source display area. To use any of these commands, click on the appropriate button with the left mouse button. The Main View control panel is described below.

Status and Entry Fields in the Main View Control Panel

The panel contains the following fields:

Command 

Lets you enter the command for running the process with any argument(s).

Status 

Displays information about the execution status of the program you are debugging. The top line in this box tells you whether the program is running or stopped. The next line lists the current call stack frame, if applicable. (To see all of the stack frames, open the Call Stack View from the Views menu.)

Execution Control Buttons

The execution control buttons enable you to control program execution. The two control buttons for starting and terminating a process are:

Run 

Creates a new process for the program and starts execution. It is also used to rerun the program.

Kill 

Kills the active process.

The control buttons used for process interruptions are

Continue 

Resumes program execution after a halt and continues until a breakpoint or other event stops execution.

Stop 

Stops execution of the program. When program execution stops, the current source line is highlighted in the Main View and annotated with an arrow indicating the program counter (PC).

Step Into 

Steps to the next source line and into function calls. To step a specific number of lines, hold down the right mouse button over the Step Into button. This displays the popup menu shown in Figure 5-2. You can select one of the fixed values or enter your own number of steps by selecting "N...". Selecting "N..." displays the dialog box shown at the right in Figure 5-2.

Figure 5-2. Step Into Popup Menu and Dialog Box

Figure 5-2 Step Into Popup Menu and Dialog Box

Step Over 

Steps to the next source line and over function calls. To step a specific number of lines, hold down the right mouse button over the Step Over button. This displays the popup menu shown in Figure 5-3. You can select one of the fixed values or enter your own number of steps by selecting "N...". Selecting "N..." displays the dialog box shown at the right in Figure 5-3.

Figure 5-3. Step Over Popup Menu and Dialog Box

Figure 5-3 Step Over Popup Menu and Dialog Box

Return 

Executes the remaining instructions in the current function. Program execution stops upon return from that procedure.

There is one button in the control panel for spontaneous sampling:

Sample 

Collects performance data when clicked. A performance task must have been previously specified in the Performance Task window and data collection must have been enabled.

Controlling Process Execution With PC Menu

The PC (program counter) menu in Main View provides a quick and informal means of controlling process execution. See Figure 5-4.

Figure 5-4. PC Menu in Main View

Figure 5-4 PC Menu in Main View

These options let you manually control process execution without setting traps. The target location is determined by the location of the cursor in the source display area. There are two selections:

"Continue To" 

Lets you select a target location in the current process (by placing the cursor in the line). The process proceeds from the current PC to that point (provided there are no interruptions) and stops there, as it would for a stop trap. "Continue To" is equivalent to setting a one-time trap. If the process is interrupted before reaching the target location, then the command is cancelled.

"Jump To" 

Lets you select a target location in the current process (by placing the cursor in the line). The location must be in the same function. Instead of starting from the current PC, "Jump To" skips over any intervening code and restarts the process at the target. This is particularly useful if you want to get around bad code or irrelevant portions of the program. It also lets you back up and re-execute a portion of code.

Execution View

The Execution View window is a simple shell that lets you set environment variables and inspect error messages. Your target program I/O, if any, is displayed in the Execution View window. If the program is I/O-based, then all interaction takes place in Execution View.


Note: When you launch the debugger, the Execution View is launched in iconified form.