Debugging your programs

 

In this section, you will debug a StreamIt program.

 

  1. In the Package Explorer view, find Minimal.str and double-click it to open it in an editor.
  2. Place your cursor on the vertical ruler along the left edge of the editor area on line 11:

 

push(x++);

 

and double-click on the ruler to set a breakpoint.  Repeat the same process on line 18.

 

 

  1. The breakpoint icon indicates the status of the breakpoint.  The plain blue breakpoint icon indicates that the breakpoint has been set, but not yet installed.

 

Note: Once the program is run, the breakpoint will be installed and a checkmark overlay will be displayed on the breakpoint icon.

  1. In the Package Explorer view, select the Minimal.str and select the Run menu.  Within the Run menu, select Debug As, and then StreamIt Application.
  2. The program will run until the breakpoint is reached.  When the breakpoint is hit, the Debug perspective opens, and execution is suspended. Notice that the process is still active (not terminated) in the Debug view. Other threads might still be running.

 

 

Note: The breakpoint now has a checkmark overlay the program was run.

  1. The Variables view displays the values of the variables in the selected stack frame. Expand the IntSource tree in the Variables view until you can see x.

 

 

  1. The variables (e.g., x) in the Variables view will change when you continue through Minimal in the Debug view.  To continue through the code, click the Resume button.  Execution will continue until the next breakpoint is encountered or until the program is completed.
  2. You can end a debugging session by allowing the program to run to completion or by terminating it.  Select Terminate from the context menu of the program's process in the Debug view to terminate the program.

 

Related concepts

Breakpoints and watchpoints

Program launch support

General debugging support and Eclipse integration

Stream graph display and navigation

 

Related tasks

Local debugging

Launching a StreamIt program in debug mode

Resuming the execution of suspended threads

Inspecting child streams and state variables

Adding breakpoints

Viewing and navigating Stream graphs

Identifying stream elements and channels