[OpenVMS documentation]
[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
Updated: 11 December 1998

OpenVMS Debugger Manual


Previous Contents Index


Chapter 7
Screen Mode

Screen mode is an enhancement to the command line interface of the OpenVMS debugger that enables you to simultaneously display separate groups of data about the debugging session, in a manner similar to that available with the DECwindows Motif interface (see Part 3). For example, you can display source code in one portion of the screen, register contents in a different portion, debugger output in another portion, and so on.

To invoke screen mode, press PF3 on the keypad (or enter the SET MODE SCREEN command). To return to line-oriented debugging, press PF1 PF3 (or enter the SET MODE NOSCREEN command).

Note

Note that you cannot enter screen mode from within the DECWindows Motif interface to the debugger.

Screen mode output is best displayed on VT-series terminals with higher numbers than VT52, and on workstations running VWS. The larger screen of workstations is particularly suitable to using a number of displays for different purposes.

This chapter covers the following topics:

Many screen mode commands are bound to keypad keys. For key definitions, see Appendix A.

Note

This chapter provides information common to programs that run in one or several processes. See Chapter 15 for additional information specific to multiprocess programs.

7.1 Concepts and Terminology

A display is a group of text lines. The text can be lines from a source file, assembly-language instructions, the values contained in registers, your input to the debugger, debugger output, or program input and output.

You view a display through its display window, which can occupy any rectangular area of the screen. Because a display window is typically smaller than the associated display, you can scroll the display window up, down, right, and left across the display text to view any part of the display.

Figure 7-1 is an example of screen mode that shows three display windows. The name of each display (SRC, OUT, and PROMPT) appears at the top left corner of its display window. The display name serves both as a tag on the display itself and as a name for future reference in commands.

Figure 7-1 Default Screen Mode Display Configuration


Figure 7-1 is the default display configuration established when you first invoke screen mode. SRC, OUT, and PROMPT are three of the predefined displays that the debugger provides when you enter screen mode (see Section 7.4). You can modify the configuration of these displays as well as create additional displays.

Displays SRC, OUT, and PROMPT have the following basic characteristics:

Conceptually, displays are placed on the screen as on a pasteboard. The display most recently referenced by a command is put on top of the pasteboard by default. Therefore, depending on their screen locations, display windows that you have referenced recently might overlay or hide other display windows.

The debugger maintains a display list, which is the pasting order of displays. Several keypad key definitions use the display list to cycle through the displays currently on the pasteboard.

Every display belongs to a display kind (see Section 7.2). The display kind determines what type of information the display can capture and display, such as source code, or debugger output. The display kind defines whether displayed data is paged into the memory buffer or discarded when the memory buffer overflows. The display kind also determines how the contents of the display are generated.

The contents of a display are generated in two ways:

The names of any attributes assigned to a display appear to the right of the display name, in lowercase letters. In Figure 7-1, SRC has the source and scroll attributes (SRC is the current source display and the current scrolling display), OUT has the output attribute (it is the current output display), and so on. Note that, although SRC is automatically updated by its own built-in command, it can also receive the output of certain interactive commands (such as EXAMINE/SOURCE) because it has the source attribute.

The concepts introduced in this section are developed in more detail in the rest of this chapter.

7.2 Display Kinds

Every display has a display kind. The display kind determines the type of information a display contains, how that information is generated, and whether the memory buffer associated with the display is paged.

Typically, you specify a display kind when you use the DISPLAY command to create a new display (if you do not specify a display kind, an output display is created). You can also use the DISPLAY command to change the display kind of an existing display with the following keywords:

The contents of a register display are generated and updated automatically by the debugger. The contents of other kinds of displays are generated by commands, and these display kinds fall into two general groups.

A display that belongs to one of the following display kinds has its contents updated automatically according to the command or command list you supply when defining that display:

The command list specified is executed each time the debugger gains control from your program, if the display is not marked as removed. The output of the commands forms the new contents of the display. If the display is marked as removed, the debugger does not execute the command list until you view that display (marking that display as unremoved).

A display that belongs to one of the following display kinds derives its contents from commands that you enter interactively:

To direct debugger output to a specific display in this group, you must first select it with the SELECT command. The technique is explained in the following sections and in Section 7.3. After a display is selected for a certain type of output, the output from your commands forms the contents of the display.

7.2.1 DO (Command[;...]) Display Kind

A DO display is an automatically updated display. The commands in the command list are executed in the order listed each time the debugger gains control from your program. Their output forms the contents of the display and erases any previous contents.

For example, the following command creates the DO display CALLS at window Q3. Each time the debugger gains control from the program, the SHOW CALLS command is executed and the output is displayed in CALLS, replacing any previous contents.


DBG> DISPLAY CALLS AT Q3 DO (SHOW CALLS)

The following command creates a DO display named V2_DISP that shows the contents of elements 4 to 7 of the vector register V2 (using Fortran array syntax). The display is automatically updated whenever the debugger gains control from the program:


DBG> DISPLAY V2_DISP AT RQ2 DO (EXAMINE %V2(4:7))

The default size of the memory buffer associated with any DO 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.2 INSTRUCTION Display Kind

An instruction display shows the output of an EXAMINE/INSTRUCTION command within the instruction stream of a routine. Because the instructions displayed are decoded from the image being debugged and show the exact code that is executing, this kind of display is particularly useful in helping you debug optimized code (see Section 14.1).

In the display, one line is devoted to each instruction. Source-line numbers corresponding to the instructions are displayed in the left column. The instruction at the location being examined is centered in the display and is marked by an arrow in the left column.

Before anything can be written to an instruction display, you must select it as the current instruction display with the SELECT/INSTRUCTION command.

In the following example, the DISPLAY command creates the instruction display INST2 at RH1. The SELECT/INSTRUCTION command then selects INST2 as the current instruction display. When the EXAMINE/INSTRUCTION X command is executed, window RH1 fills with the instruction stream surrounding the location denoted by X. The arrow points to the instruction at location X, which is centered in the display.


DBG> DISPLAY INST2 AT RH1 INSTRUCTION
DBG> SELECT/INSTRUCTION INST2
DBG> EXAMINE/INSTRUCTION X

Each subsequent EXAMINE/INSTRUCTION command updates the display.

The default size of the memory buffer associated with any instruction display is 64 lines; however, you can scroll back and forth to view all the instructions within the routine. You can use the DISPLAY/SIZE command to change the buffer size and improve performance.

7.2.3 INSTRUCTION (Command) Display Kind

This is an instruction display that is automatically updated with the output of the command specified. That command, which must be an
EXAMINE/INSTRUCTION command, is executed each time the debugger gains control from your program.

For example, the following command creates the instruction display INST3 at window RS45. Each time the debugger gains control, the built-in command EXAMINE/INSTRUCTION .%INST_SCOPE\%PC is executed, updating the display.


DBG> DISPLAY INST3 AT RS45 INSTRUCT (EX/INST .%INST_SCOPE\%PC)

This command creates a display that functions like the predefined display INST. The built-in EXAMINE/INSTRUCTION command displays the instruction at the current PC value in the current scope (see Section 7.4.4).

If an automatically updated instruction display is selected as the current instruction display, it is updated like a simple instruction display by an interactive EXAMINE/INSTRUCTION command (in addition to being updated by its built-in command).

The default size of the memory buffer associated with any instruction display is 64 lines; however, you can scroll back and forth to view all the instructions within the routine. You can use the DISPLAY/SIZE command to change the buffer size and improve performance.

7.2.4 OUTPUT Display Kind

An output display shows any debugger output that is not directed to another display. New output is appended to the previous contents of the display.

Before anything can be written to an output display, it must be selected as the current output display with the SELECT/OUTPUT command, or as the current error display with the SELECT/ERROR command, or as the current input display with the SELECT/INPUT command. See Section 7.3 for more information about using the SELECT command with output displays.

In the following example, the DISPLAY command creates the output display OUT2 at window T2 (the display kind OUTPUT can be omitted from this example, because it is the default kind). The SELECT/OUTPUT command then selects OUT2 as the current output display. These two commands create a display that functions like the predefined display OUT:


DBG> DISPLAY OUT2 AT T2 OUTPUT
DBG> SELECT/OUTPUT OUT2

OUT2 now collects any debugger output that is not directed to another display. For example:

The default size of the memory buffer associated with any output 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.5 REGISTER Display Kind

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.

On VAX processors, the predefined display REG contains, in hexadecimal format, general-purpose registers R0 to R15 and the PSL, but does not contain the vector registers. To display data contained in vector registers or vector control registers in screen mode, use a DO display (see Section 7.2.1).

On VAX processors, the predefined display IREG contains the same information as the predefined display REG, but the display window is configured differently. Display IREG is included in the VAX implementation to allow debugger .COM and .INI files to be ported more easily between VAX and Alpha debugging applications.

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 can 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:

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:
SELECT Qualifier Apply to Display Kind Description
/ERROR Output
Prompt
Selects the specified display as the current error display. Directs any subsequent debugger diagnostic message to that display. If no display is specified, selects the PROMPT display as the current error display.
/INPUT Output Selects the specified display as the current input display. Echoes any subsequent debugger input in that display. If no display is specified, unselects the current input display: debugger input is not echoed to any display.
/INSTRUCTION Instruction Selects the specified display as the current instruction display. Directs the output of any subsequent EXAMINE/INSTRUCTION command to that display. Keypad key sequence PF4 COMMA selects the next instruction display in the display list as the current instruction display. If no display is specified, unselects the current instruction display: no display has the instruction attribute.
/OUTPUT Output
Prompt
Selects the specified display as the current output display. Directs any subsequent debugger output to that display, except where a particular type of output is being directed to another display (such as diagnostic messages going to the current error display). Keypad key sequence PF1 KP3 selects the next output display in the display list as the current output display. If no display is specified, selects the PROMPT display as the current output display.
/PROGRAM Prompt Selects the specified display as the current program display. Tries to force any subsequent program input or output to that display. If no display is specified, unselects the current program display: program input and output are no longer forced to the PROMPT display.
/PROMPT Prompt Selects the specified display as the current prompt display where the debugger prompts for input. You cannot unselect the PROMPT display.
/SCROLL All Selects the specified display as the current scrolling display. Makes that display the default display for any subsequent SCROLL, MOVE, or EXPAND command. You can specify any display (however, note that the PROMPT display cannot be scrolled). The /SCROLL qualifier is the default if you do not specify a qualifier with the SELECT command. Key KP3 selects as the current scrolling display the next display in the display list after the current scrolling display. If no display is specified, unselects the current scrolling display: no display has the scroll attribute.
/SOURCE Source Selects the specified display as the current source display. Directs the output of any subsequent TYPE or EXAMINE/SOURCE command to that display. Keypad key sequence PF4 KP3 selects the next source display in the display list as the current source display. If no display is specified, unselects the current source display: no display has the source 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.


Previous Next Contents Index

[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
[OpenVMS documentation]

Copyright © Compaq Computer Corporation 1998. All rights reserved.

Legal
4538PRO_014.HTML