The PTP Debug Perspective

Main features of the PTP Debug perspective

Here is a view of the PTP Debug perspective, showing

Launching a parallel debug session

The Parallel Debug Perspective:


The debug perspective appears as in the example above. This is a launch with 32 processes set on the launch configuration. The Parallel Debug view shows the 32 processes (yellow diamonds indicate a stopped process); the Debug view shows process 0 stopped at main; the Source view shows the line at which process 0 is stopped.

Note that the breakpoints view (upper right) is empty, since no breakpoints are set. You can view the variables in this area by selecting the tab on the Variables View

Note that most variables don't have valid values yet since we haven't executed their initializations in the program.

Process Sets

Traditional debuggers apply operations to a single process. Parallel debugging operations apply to a single process or to arbitrary collections of processes.

A process set is a means of simultaneously referring to one or more processes.

When a parallel debug session is first started, all processes are placed in a set, called the 'Root' set. Sets are always associated with a single Job. A job can have any number of process sets. A set can contain from 1 to the number of processes in a job.

Operations on Process sets

Use the icons in the toolbar of the Parallel Debug view to create, modify, and delete process sets, and to change the current process set.

Debug operations on the Parallel Debug View toolbar always apply to the current set.

Creating Process Sets

Select the processes to be placed in the set by selecting a rectangular region with the mouse, or click the mouse and shift-click or ctrl-click to select a contiguous region, or separate processes, respectively.

Selecting a rectangular set:

Create a process set from the group that was selected by clicking on the image in the icon ..

Or, add the group of processes to an existing process set by clicking on the down-arrow to the right of the icon:

To change the current process set, select the icon and choose from the list via the down-arrow , or click on the image in the icon itself to cycle through the sets.

To remove processes from the current set, select the processes as described above, and Click the "Remove Elements" button.

Select the "Delete Set" icon to delete the current process set.

Breakpoints

There are two main types of parallel breakpoints in PTP.

Setting Breakpoints

To create a breakpoint, double-click on the left edge of an editor window, at the line on which you want to set the breakpoint. Or, right click and use the context menu.

A global breakpoint is created if no jobs are selected. If a job is selected, the breakpoint will apply to the current set.

Breakpoint information

Hover over a breakpoint to see more information.

Use the Breakpoints view to see all breakpoints.

Use the menu in the Breakpoints view to group breakpoints by type.

For example the above selection will list the breakpoints by process set.

Current Instruction Pointer

The current instruction pointer is used to show the current location of suspended processes. In traditional programs, there is a single instruction pointer. (The exception to this is multi-threaded programs.) In parallel programs, there is an instruction pointer for every process.

The PTP debugger shows one instruction pointer for every group of processes at the same location.

Note: The group of processes represented by an instruction pointer is not necessarily the same as a process set.

In the normal debugger, the single instruction pointer is indicated with the blue arrow icon. The current source line is also highlighted.

In the PTP (parallel) debugger, there are multiple instruction pointers. The marker depends on the type of process stopped at that location.

The highlight color of the current instruction pointer depends on the stack frame. In the following image, the green background indicates a registered process; the brown background indicates an unregistered process. The blue band behind the highlight color of the line tracks the current stack frame.

Hovering over the instruction pointer provides additional information.

Process Registration and the Debug View

Process set commands apply to groups of processes. For finer control and more detailed information, a process can be registered and isolated in the Debug View.

Registered processes, including their stack traces, appear in the 'Debug' view. Any number of processes can be registered, and processes can be registered or un-registered at any time.

To register a process, double-click its process icon in the Jobs view. Note that the process "diamond" then is surrounded by a box. The process appears in the debug view.

To un-register a process, double-click on the same icon. The box disappears, and the process is removed from the debug view.

Note that the debug commands (icons including run, step, etc.) in the toolbar of the Jobs view (tab title: Parallel Debug) control the currently selected process set. The debug commands in the toolbar of the Debug view control the single process that is currently selected in that view.

PTP Variable View

The PTP Variable view allows you to view a particular variable's values across the various processes.

If you open the PTP Variable View (Window -> Show View -> Other) you can add a variable.

This opens the PTP Variable Dialog which allows you to select a variable or expression, and a process set (use Root for all processes) for which to create the variable to watch for each process.

Then when you mouse over a process icon in the Parallel Debug view, it will show the value of the variable in the tooltip.

Putting it all together

Note that with the above instructions, you should now be able to do the following: Answers are in italics.

Back to Top | Back to Table of Contents