Previous | Contents | Index |
A register display is an automatically updated display that shows the current values, in hexadecimal format, of the processor registers and as many of the top call-stack values as will fit in the display.
The register values displayed are for the routine in which execution is currently paused. The values are updated whenever the debugger takes control. Any changed values are highlighted.
There are up to three predefined register displays. The REG, IREG, and FREG displays are predefined on Alpha and Integrity server processors. The contents of the predefined displays are shown in Table 7-1.
Display | Alpha | Intel Itanium |
---|---|---|
REG |
- R0 to R31
- PC - PS - F0 to F31 - FPCR - SFPCR - top of call-stack values |
- PC
- CFM - R1 to R31 - R32 to R127 ( as many as are used) - F2 to F127 - top-of-stack values |
IREG |
- R0 to R31
- PC - PS - top of call-stack values The data is shown in hexadecimal format. |
- PC
- CFM - R1 to R31 - top of call-stack values The data is shown in hexadecimal format. |
FREG |
- F0 to F31
- FPCR - SFPCR - top of call-stack values The data is shown in floating-point format. |
- F2 to F127
- top-of-stack values The register data is shown in the format consistent with the data value (integer or floating-point); the stack values are shown in floating-point format. |
On Alpha processors, the predefined display REG contains, in hexadecimal format, general-purpose registers R0 to R28, FP (R29), SP (R30), R31, PC, PS floating-point registers F0 to F31, FPCR, SFPCR, and as many of the top call-stack values as will fit in the display.
On Alpha processors, the predefined display IREG contains, in hexadecimal format, general-purpose registers R0 to R28, FP, and as many of the top call-stack values as can be displayed in the window.
On Alpha processors, the predefined display FREG contains floating-point registers F0 to F31, FPCR, SFPCR, displayed in floating-point format and as many of the top call-stack values (in hexadecimal format) as can be displayed in the window.
The default size of the memory buffer associated with any register
display is 64 lines. When the memory buffer is full, the oldest lines
are discarded to make room for new text. You can use the DISPLAY/SIZE
command to change the buffer size.
7.2.6 SOURCE Display Kind
A source display shows the output of a TYPE or EXAMINE/SOURCE command within the source code of a module, if that source code is available. Source line numbers are displayed in the left column. The source line that is the output of the command is centered in the display and is marked by an arrow in the left column. If a range of lines is specified with the TYPE command, the lines are centered in the display, but no arrow is shown.
Before anything can be written to a source display, you must select it as the current source display with the SELECT/SOURCE command.
In the following example, the DISPLAY command creates source display SRC2 at Q2. The SELECT/SOURCE command then selects SRC2 as the current source display. When the TYPE 34 command is executed, window RH1 fills with the source code surrounding line 34 of the module being debugged. The arrow points to line 34, centered in the display.
DBG> DISPLAY SRC2 AT Q2 SOURCE DBG> SELECT/SOURCE SRC2 DBG> TYPE 34 |
Each subsequent TYPE or EXAMINE/SOURCE command updates the display.
The default size of the memory buffer of a source display is 64 lines.
The memory buffer of a source display is paged, enabling you to scroll
back and forth through the entire source module or routine. You can use
the DISPLAY/SIZE command to change the buffer size to improve
performance.
7.2.7 SOURCE (Command) Display Kind
This is a source display that is automatically updated with the output of the command specified. That command, which must be an EXAMINE/SOURCE or TYPE command, is executed each time the debugger gains control from your program.
For example, the following command creates source display SRC3 at window RS45. Each time the debugger gains control, it executes the built-in command EXAMINE/SOURCE .%SOURCE_SCOPE\%PC and updates the display.
DBG> DISPLAY SRC3 AT RS45 SOURCE (EX/SOURCE .%SOURCE_SCOPE\%PC) |
This command creates a display that functions like the predefined display SRC. The built-in EXAMINE/SOURCE command displays the source line for the current PC value in the current scope (see Section 7.4.1).
If you select an automatically updated source display as the current
source display, it displays the output generated by an interactive
EXAMINE/SOURCE or TYPE command in addition to the output generated by
its built-in command.
The default size of the memory buffer of a source display is 64 lines.
The memory buffer of an automatically updated source display is paged,
enabling you to scroll back and forth through the entire source module
or routine. You can use the DISPLAY/SIZE command to change the buffer
size to improve performance.
7.2.8 PROGRAM Display Kind
A program display can receive the output of the program being debugged. The predefined PROMPT display belongs to the program display kind, and is the only display permitted of that kind. You cannot create a new display of the program display kind.
To avoid possible confusion, the PROMPT display has several
restrictions (see Section 7.4.3).
7.3 Display Attributes
In screen mode, the output from commands you enter interactively is directed to various displays according to the type of output and the display attributes assigned to these displays. For example, debugger diagnostic messages go to the display that has the error attribute (the current error display). By assigning one or more attributes to a display, you can mix or isolate different kinds of information.
The attributes have the following names:
error
input
instruction
output
program
prompt
scroll
source
When a display is assigned an attribute, the name of that attribute appears in lowercase letters on the top border of its window to the right of the display name. Note that the scroll attribute does not affect debugger output but is used to control the default display for the SCROLL, MOVE, and EXPAND commands.
By default, attributes are assigned to the predefined displays as follows:
To assign an attribute to a display, use the SELECT command with the qualifier of the same name as the attribute. In the following example, the DISPLAY command creates the output display ZIP. The SELECT/OUTPUT command then selects ZIP as the current output display---the display that has the output attribute. After this command is executed, the word "output" disappears from the top border of the predefined output display OUT and appears instead on display ZIP, and all the debugger output formerly directed to OUT is now directed to ZIP.
DBG> DISPLAY ZIP OUTPUT DBG> SELECT/OUTPUT ZIP |
You can assign specific attributes only to certain display kinds. The following list identifies each of the SELECT command qualifiers, its effect, and the display kinds to which you can assign that attribute:
Subject to the restrictions listed, a display can have several attributes. In the preceding example, ZIP was selected as the current output display. In the next example, ZIP is further selected as the current input, error, and scrolling display. After these commands are executed, debugger input, output, and diagnostics are logged in ZIP in the proper sequence as they occur, and ZIP is the current scrolling display.
DBG> SELECT/INPUT/ERROR/SCROLL ZIP |
To identify the displays currently selected for each of the display attributes, use the SHOW SELECT command.
If you use the SELECT command with a particular qualifier but without
specifying a display name, the effect is typically to deassign that
attribute (to unselect the display that had the attribute). The exact
effect depends on the attribute, as described in the preceding table.
7.4 Predefined Displays
The debugger provides the following predefined displays that you can use to capture and display different kinds of data:
SRC, the predefined source display
OUT, the predefined output display
PROMPT, the predefined prompt display
INST, the predefined instruction display
REG, the predefined register display
FREG, the predefined floating-point register display (Alpha only)
IREG, the predefined integer register display
When you enter screen mode, the debugger puts SRC in the top half of the screen, PROMPT in the bottom sixth, and OUT between SRC and PROMPT, as shown in Figure 7-1. Displays INST, REG, FREG (Alpha only), and IREG are initially removed from the screen by default.
To re-create this default configuration, press BLUE MINUS on the keypad (PF4 followed by the MINUS (--) key).
The basic features of the predefined displays are described in the next sections. As explained in other parts of this chapter, you can change certain characteristics of these displays, such as the buffer size or display attributes. You can also create additional displays similar to the predefined displays.
To display summary information about the characteristics of any display, use the SHOW DISPLAY command.
Table 7-2 summarizes key information about the predefined displays.
Display Name | Display Kind | Valid Display Attributes | Visible on Startup |
---|---|---|---|
SRC | Source |
Scroll
Source (By Default) |
X |
OUT | Output |
Error
Input Output (By Default) Scroll |
X |
PROMPT | Output |
Error (By Default)
Output Program (By Default) Prompt (By Default) Scroll 1 |
X |
INST | Instruction |
Instruction
Scroll |
|
REG | Register | Scroll | |
FREG (Alpha only) | Register | Scroll | |
IREG | Register | Scroll |
See Chapter 6 for information about how to make source code available for display during a debugging session. |
The predefined display SRC (see Figure 7-1) is an automatically updated source display.
You can use SRC to display source code in two basic ways:
The name of the module whose source code is displayed is shown at the right of the display name, SRC. The numbers displayed at the left of the source code are the compiler-generated line numbers, as they might appear in a compiler-generated listing file.
As you execute the program under debugger control, SRC is automatically updated whenever execution is paused. The arrow in the leftmost column indicates the source line to be executed next. Specifically, execution is paused at the first instruction associated with that source line. Thus, the line indicated by the arrow corresponds to the current program counter (PC) value. The PC is a register that contains the memory address of the next instruction to be executed.
If the debugger cannot locate source code for the routine in which execution is paused (because, for example, the routine is a run-time library routine), it tries to display source code in the next routine down on the call stack for which source code is available. When displaying source code for such a routine, the debugger issues the following message:
%DEBUG-I-SOURCESCOPE, Source lines not available for .0\%PC. Displaying source in a caller of the current routine. |
Figure 7-2 shows this feature. The source display shows that a call to routine TYPE is currently active. TYPE corresponds to a Fortran run-time library procedure. No source code is available for that routine, so the debugger displays the source code of the calling routine. The output of a SHOW CALLS command, shown in the output display, identifies the routine where execution is paused and the call sequence leading to that routine.
In such cases, the arrow in the source window identifies the line to which execution returns after the routine call. Depending on the source language and coding style, this might be the line that contains the call statement or the next line.
Figure 7-2 Screen Mode Source Display When Source Code Is Not Available
If your program was optimized during compilation, the source code displayed in SRC might not always represent the code that is actually executing. The predefined instruction display INST is useful in such cases, because it shows the exact instructions that are executing (see Section 7.4.4).
The built-in command that automatically updates display SRC is EXAMINE/SOURCE .%SOURCE_SCOPE\%PC. For information about the EXAMINE/SOURCE command, see Section 6.4. The built-in debugger symbol %SOURCE_SCOPE denotes a scope and has the following properties:
You can use display SRC to display source code throughout your program, if source code is available for display:
After manipulating the contents of display SRC, you can redisplay the
location at which execution is currently paused (the default behavior
of SRC) by pressing KP5.
7.4.1.2 Displaying Source Code for a Routine on the Call Stack
The command SET SCOPE/CURRENT lets you display the source code for any routine that is currently on the call stack. For example, the following command updates display SRC so that it shows the source code for the caller of the routine in which execution is currently paused:
DBG> SET SCOPE/CURRENT 1 |
To reset the default scope for displaying source code, enter the
command CANCEL SCOPE. The command causes display SRC to show the source
code for the routine at the top of the call stack where execution is
paused.
7.4.2 Predefined Output Display (OUT)
Figure 7-1 and Figure 7-2 show some typical debugger output in the predefined display OUT.
Display OUT is a general-purpose output display. By default, OUT has the output attribute so it displays any debugger output that is not directed to the source display SRC or the instruction display INST. For example, if display INST is not displayed or does not have the instruction attribute, any output that would otherwise update display INST is shown in display OUT.
By default, OUT does not display debugger diagnostic messages (these appear in the PROMPT display). You can assign display attributes to OUT so that it captures debugger input and diagnostics as well as normal output (see Section 7.3).
By default, the memory buffer associated with predefined display OUT contains 100 lines.
Previous | Next | Contents | Index |