Cursors Overview

When you debug an ordinary single-process program there is only one 'current' execution point. With parallel program the situation is much more difficult. Any parallel program consists of several, sometimes several hundreds, processes and each of these processes has its 'current' execution point. During debugging each process of a parallel program is associated with some cursor that corresponds to process' current execution point. The cursors that correspond to the same execution point are grouped into one compound cursor. Thus, we introduce two notions – process cursor and compound cursor. Process cursor is the 'current' execution point of the process. Compound cursor is a group of process cursors corresponding to the same line in the source code. Hereinafter we will call compound and process cursors "debug cursor" or just "cursor". When the debugged program breaks execution all currently existing debug cursors are displayed in the Cursor window (see Debug info window). Cursors can be either red or amber or green. Since a parallel program usually consists of many processes, in general there may be several cursors of each color. In the mpC debugger you continue execution of cursors. It means that when you move a cursor, you continue execution of all processes corresponding to this cursor. All debugger moving commands can be divided in two categories: "step" commands and "go" commands. Step into, Step over and Step out commands belong to the first category, while Go and Go to cursor commands belong to the second category. You can use step commands for processes corresponding to green cursors only. Go commands can be used for processes corresponding either to green cursors only or to both green and amber cursors. Using the debugger moving commands, you can't continue execution of the processes corresponding to red cursors (see Moving Commands). Green and amber cursors can be split into several new cursors or merged with other cursors of the same color and corresponding to the same position in the source code. Also green and amber cursors can be recolored. Thus, by making some cursor amber you can hold execution of the processes corresponding to this cursor and continue execution of other processes – these corresponding to green cursors - using the Go or Go to cursor command.

Cursors allow you to treat a parallel program as a whole, while other known parallel debugger treat a parallel program as a set of independent processes communicating with each other. You can divide the parallel program into several cursors and control execution of groups of processes.

This chapter explains how to use commands that allow you to manage cursors. The following topics are discussed in this chapter:

Remember that you can’t merge, split or change color of red cursors.

See also:

Go command

Go to cursor command