![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
OpenVMS Debugger Manual
4.2.2 ASCII String TypesWhen displaying an ASCII string value, the debugger encloses it within quotation marks (") or apostrophes ('), depending on the language syntax. For example:
To deposit a string value (including a single character) into a string variable, you must enclose the value in quotation marks (") or apostrophes ('). For example:
If the string has more ASCII characters (1 byte each) than can fit into the location denoted by the address expression, the debugger truncates the extra characters from the right and issues the following message:
If the string has fewer characters, the debugger pads the remaining
characters to the right of the string by inserting ASCII space
characters.
You can examine an entire array aggregate, a single indexed element, or a slice (a range of elements). However, you can deposit into only one element at a time. The following examples show typical operations with arrays. The following command displays the values of all the elements of the array variable ARRX, a one-dimensional array of integers:
The following command displays the value of element 4 of array ARRX (depending on the language, parentheses or brackets are used to denote indexed elements):
The following command displays the values of all the elements in a slice of ARRX. This slice consists of the range of elements from element 2 to element 5:
In general, a range of values to be examined is denoted by two values separated by a colon (value1:value2). Depending on the language, two periods (..) can be used instead of a colon. You can deposit a value to only a single array element at a time (you cannot deposit to an array slice or an entire array aggregate with a single DEPOSIT command). For example, the following command deposits the value 53 into element 2 of ARRX:
The following command displays the values of all the elements of array REAL_ARRAY, a two-dimensional array of real numbers (three per dimension):
The debugger issues a diagnostic message if you try to deposit to an index value that is out of bounds. For example:
In the previous example, the deposit operation was executed because the diagnostic message is of I level. This means that the value of some array element adjacent to (1,3), possibly (2,1) might have been affected by the out-of-bounds deposit operation. To deposit the same value to several components of an array, you can use a looping command such as FOR or REPEAT. For example, assign the value RED to elements 1 to 4 of the array COLOR_ARRAY:
You can also use the built-in symbols (.) and (^) to step through array
elements, as explained in Section 4.1.8.
You can examine an entire record aggregate, a single record component, or several components. However, you can deposit into only one component at a time. The following examples show typical operations with records. The following command displays the values of all the components of the record variable PART:
The following command displays the value of component IN_STOCK of record PART (general syntax):
The following command displays the value of the same record component using COBOL syntax (the language must be set to COBOL):
The following command displays the values of two components of record PART:
The following command deposits a value into record component IN_STOCK:
4.2.5 Pointer (Access) TypesYou can examine the entity designated (pointed to) by a pointer variable and deposit a value into that entity. You can also examine a pointer variable. For example, the following Pascal code declares a pointer variable A that designates a value of type real:
The following command displays the value of the entity designated by the pointer variable A:
In the following example, the value 3.9 is deposited into the entity designated by A:
When you specify the name of a pointer variable with the EXAMINE command, the debugger displays the memory address of the object it designates. For example:
4.3 Examining and Depositing InstructionsThe debugger recognizes address expressions that are associated with instructions. This enables you to examine and deposit instructions using the same basic techniques as with variables. When debugging at the instruction level, you might find it convenient to first enter the following command. It sets the default step mode to stepping by instruction:
There are other step modes that enable you to execute the program to specific kinds of instructions. You can also set breakpoints to interrupt execution at these instructions.
In addition, you can use a screen-mode instruction display (see
Section 7.4.4) to display the actual decoded instruction stream of your
program.
If you specify an address expression that is associated with an instruction in an EXAMINE command (for example, a line number), the debugger displays the first instruction at that location. You can then use the period (.), Return key, and circumflex (^) to display the current, next, and previous instruction (logical entity), as described in Section 4.1.8. For example, on Alpha processors:
Line numbers, routine names, and labels are symbolic address expressions that are associated with instructions. In addition, instructions might be stored in various other memory addresses and in certain registers during the execution of your program. The program counter (PC) is the register that contains the address of the next instruction to be executed by your program. The command EXAMINE .%PC displays that instruction. The period (.), when used directly in front of an address expression, denotes the contents of operator---that is, the contents of the location designated by the address expression. Note the following distinction:
As shown in the previous examples, the debugger knows whether an address expression is associated with an instruction. If it is, the EXAMINE command displays that instruction (you do not need to use the /INSTRUCTION qualifier). You use the /INSTRUCTION qualifier to display the contents of an arbitrary program location as an instruction---that is, the command EXAMINE/INSTRUCTION causes the debugger to interpret and format the contents of any program location as an instruction (see Section 4.5.2). When you examine consecutive instructions in a MACRO-32 program, the debugger might misinterpret data as instructions if storage for the data is allocated in the middle of a stream of instructions. The following example shows this problem. It shows some MACRO-32 code with two longwords of data storage allocated directly after the BRB instruction at line 7 (line numbers have been added to the example for clarity).
The following EXAMINE command displays the instruction at the start of line 6:
The following EXAMINE command correctly interprets and displays the logical successor entity as an instruction at line 7:
However, the following three EXAMINE commands incorrectly interpret the three logical successors as instructions:
4.4 Examining and Depositing into Registers
The EXAMINE command displays contents of any register that is
accessible in your program. You can use the DEPOSIT command to change
the contents of these registers. The number and type of registers vary
for each OpenVMS platform, as described in the following sections.
On Alpha processors, the Alpha architecture provides 32 general (integer) registers and 32 floating-point registers, some of which are used for temporary address and data storage. Table 4-1 identifies the debugger built-in symbols that refer to Alpha registers.
On Alpha processors:
The following examples show how to examine and deposit into registers:
See Section 4.3.1 for specific information about the PC. On Alpha processors, the processor status (PS) is a register whose value represents a number of processor state variables. The first three bits of the PS are reserved for the use of the software. The values of these bits can be controlled by a user program. The remainder of the bits, bits 4 to 64, contain privileged information and cannot be altered by a user-mode program. The following example shows how to examine the contents of the PS:
See the Alpha Architecture Reference Manual for complete information about the PS, including the values of the various bits. You can also display the information in the PS in other formats. For example:
The command EXAMINE/PS displays the value at any location in PS format.
This is useful for examining the combined current and saved PS values.
On Integrity server processors, the Integrity server architecture provides:
Most of these registers are read/writable from user mode debug. Some, however, are not writable and others are only accessible from the higher privileges related with the System Code Debugger (SCD) configuration (see OpenVMS Alpha System Analysis Tools Manual).
On Integrity server processors:
|