
Chapter 9. Programming tools 93
The user can move to the source of a subroutine by clicking on the name
of the subroutine with the right mouse button.
TotalView has two execution modes: “all” or “single-processor”. In the
execution mode “all”, the breakpoints and execution commands are ap-
plied to all processors simultaneously. In the single-processor execution
mode, the user can set breakpoints individually for each processor. The
execution mode is selected from the PSet menu. In the single-processor
mode the active processor is selected from a slider marked PE just below
the Pset menu.
The value of any variable can be examined by pressing the Print... button
in the middle of the TotalView window. This brings up another window
with the name of the variable as input. The actual values are shown
in a third window, where the processor can be selected using a slider.
The value can also be displayed by choosing the variable name in the
program listing or the variable listing with the right-hand mouse button.
There is also a graphical browser for arrays.
Figure 9.2 shows an example of a TotalView session. The two uppermost
window panes show the call sequence and the values of local variables.
Below these panes are buttons to control execution. Underneath is the
program code.
The user can press the oval buttons on the left to define breakpoints.
The current position is indicated with an arrow. The bottom pane in the
large window shows messages from the debugger and can be used to
issue commands manually. The small window at the bottom shows the
value of the variable mehigh for the processor number 1.
A typical debugging session could consist of the following steps:
• Set the initial breakpoint either with the mouse or select Set Break-
point in Function or Set Breakpoint at Line from the Events menu.
• Run the program to the breakpoint with the Run button. If the pro-
grams uses command-line arguments, use the Run (args) command
from the Control menu.
• Examine the values of some variables with the Print button or by
selecting the variable name with the right mouse button.
• Step through the code using the Step button.
• Step through the code without going into the called subroutines
with the Next button.
9.3.2 Examining core files
When a program terminates with an error condition, a core file is often
produced. This file contains the status of the program at the time of the
Komentarze do niniejszej Instrukcji