|
HP OpenVMS systems documentation |
Previous | Contents | Index |
The EXAMINE command enables you to look at the contents of a variable, the current table entry, an array element, or the I/O buffer.
To examine an array variable, use array syntax as in the following example:
DBG> EXAMINE ARR3(9) ! Display element 9 of array ARR3 DBG> EXAMINE ARRY(1:7) ! Display elements 1-7 of array ARRY |
Specifying a table name enables you to examine the entry retrieved from the last LOOKUP operation.
To display the contents of the I/O buffer, specify the name of the input file, update file, or output file, followed by the string $BUF. For example, the following command displays the contents of the I/O buffer for the input file INPUT:
DBG> EXAMINE INPUT$BUF |
The following command displays the ASCII equivalent of the string STRING, which is 6 characters long:
DBG> EXAMINE/ASCII:6 STRING |
To examine a variable which contains the at sign (@), use %NAME as follows:
DBG> EXAMINE %NAME 'ITEM@' |
To examine a nonexternal indicator, precede it with the string *IN. For example:
DBG> EXAMINE *IN56 *IN56: "0" |
If an indicator is set off, 0 is displayed. If an indicator is set on, 1 is displayed.
You cannot examine external indicators in this manner. To examine external indicators, you must first link the program with the /NOSYSSHR qualifier; then, use the CALL command, as in the following example which displays the value of U5:
DBG> CALL RPG$EXT_INDS(5) value returned is 0 |
Note the following points when using the DEPOSIT command:
DBG> DEPOSIT ARR(2) = 150 |
DBG> DEPOSIT/ASCII PARTS(4) = "P04P05P06" DBG> EXAMINE PARTS(4:6) INV\PARTS (4): 'P04' (5): 'P05' (6): 'P06' |
DBG> DEPOSIT *IN56 = "1" |
The EDIT command invokes the RPG II editor rather than the
Language-Sensitive Editor.
C.15 SCAN (VAX Only)
The following subtopics describe debugger support for SCAN.
C.15.1 Operators in Language Expressions
Supported SCAN operators in language expressions include:
Kind | Symbol | Function |
---|---|---|
Prefix | + | Unary plus |
Prefix | - | Unary minus (negation) |
Infix | + | Addition |
Infix | - | Subtraction |
Infix | * | Multiplication |
Infix | / | Division |
Infix | & | Concatenation |
Infix | = | Equal to |
Infix | <> | Not equal to |
Infix | > | Greater than |
Infix | >= | Greater than or equal to |
Infix | < | Less than |
Infix | <= | Less than or equal to |
Prefix | NOT | Complement |
Infix | AND | Intersection |
Infix | OR | Union |
Infix | XOR | Exclusive OR |
Supported constructs in language and address expressions for SCAN follow:
Symbol | Construct |
---|---|
( ) | Subscripting |
. (period) | Record component selection |
-> | Pointer dereferencing |
Supported SCAN predefined symbols follow:
Symbol | Meaning |
---|---|
TRUE | Boolean True |
FALSE | Boolean False |
NIL | Nil pointer |
Supported SCAN data types follow:
SCAN Data Type | Operating System Data Type Name |
---|---|
BOOLEAN | (None) |
INTEGER | Longword Integer (L) |
POINTER | (None) |
FIXED STRING ( n) | TEXT with CLASS=S |
VARYING STRING ( n) | TEXT with CLASS=VS |
DYNAMIC STRING | TEXT with CLASS=D |
TREE | (None) |
TREEPTR | (None) |
RECORD | (None) |
OVERLAY | (None) |
There is no specific support for the following data types:
FILE
TOKEN
GROUP
SET
You can use the names of the following SCAN constructs in debugger commands:
procedures
macros
constants
variables
labels
Note the following points about SCAN breakpoints, tracepoints, and
watchpoints.
C.15.6.1 Breakpoints and Tracepoints
You can set breakpoints and tracepoints on procedures, trigger macros, syntax macros, and labels, as well as line numbers. For example:
DBG> SET BREAK find_keyword ! break on a trigger macro DBG> CANCEL BREAK exit ! cancel break on label DBG> SET BREAK compare_trees ! break on a procedure |
Conventional breakpoints and tracepoints are not especially convenient for monitoring SCAN's picture matching. Where do you set a breakpoint or tracepoint to observe the tokens built by your program? There is no statement in your program on which to set such a breakpoint.
To solve this problem, VAX SCAN defines several events. By setting breakpoints or tracepoints on these events, you can observe the picture matching process.
The following event keywords are defined for SCAN programs:
Event Keyword | Description |
---|---|
TOKEN | A token is built. |
PICTURE | An operand in a picture is being matched. |
INPUT | A new line of the input stream is read. |
OUTPUT | A new line of the output stream is written. |
TRIGGER | A trigger macro is starting or terminating. |
SYNTAX | A syntax macro is starting or terminating. |
ERROR | Picture matching error recovery is starting or terminating. |
Use these keywords with the /EVENT qualifier of the following commands:
(SET,CANCEL,ACTIVATE,DEACTIVATE) BREAK
(SET,CANCEL,ACTIVATE,DEACTIVATE) TRACE
For example, the following command sets a breakpoint that triggers whenever a TOKEN is built:
DBG> SET BREAK/EVENT=TOKEN |
Recognition of SCAN events is enabled automatically by the debugger if the main program is written in SCAN. If you are debugging a program written in another language that calls a SCAN routine, proceed as follows to set up the SCAN environment:
Note the following points about SCAN watchpoints:
The following subtopics explain how to examine and deposit into the following SCAN variables:
STRING
FILL
POINTER
TREE
TREEPTR
RECORD
OVERLAY
If you deposit into a FIXED STRING variable, truncation will occur if the deposited string is longer than the size established by the declaration of that variable.
If you deposit into a VARYING STRING variable, truncation will occur if the deposited string is longer than the maximum size established by the declaration of that variable.
If you deposit into a DYNAMIC STRING variable, truncation will occur if the deposited string is longer than the current size of the variable.
With FIXED and DYNAMIC STRING variables, if the deposited string is shorter than the current size of the variable, the unfilled portion of the variable will be blank padded to the right, with the new string left justified in the variable.
In the case of VARYING STRING variables, the current size of the
variable storage space will be adjusted to the size of the deposited
string.
C.15.7.2 FILL Variables
Examining a FILL variable causes the contents of the specified variable to be displayed as a string, by default, and so may have little meaning. If the characteristics (or type) of the fill are known, the appropriate qualifier applied to the command will produce a more meaningful display. The following command example shows a fill x that is known to be a single floating number:
DBG> EXAMINE/FLOAT x |
You can examine a POINTER by name to find the address of the variable it points to. Use the operator that combines the minus sign and the greater than symbol (->) to examine the variable that is based on the POINTER.
Consider these declarations and assignments:
TYPE symnode: RECORD ptr: POINTER TO symnode, vstr: VARYING STRING( 20 ), END RECORD; DECLARE x : symnode; DECLARE xptr: POINTER TO symnode; xptr = POINTER(x); x.vstr = 'prehensile'; |
The following command displays the value of the vstr component of x:
DBG> EXAMINE x.vstr POINTER\MAINPOINTER\X.VSTR: 'prehensile' |
The following command displays the value of vstr based on the POINTER:
DBG> EXAMINE xptr->.vstr POINTER\MAINPOINTER\XPTR->.VSTR: 'prehensile ' |
You can examine the contents of the nodes in a tree using the following syntax:
EXAMINE tree_variable([subscript],...) |
You cannot deposit into a TREE variable.
If you specify the name of a tree with the EXAMINE command, the debugger displays the contents of all nodes and leaves of the tree. For example:
DBG> EXAMINE voters |
You can specify an interior node by entering the subscript for that node. For example:
DBG> EXAMINE voters('salem') |
You can examine the leaf node in a tree by specifying all subscripts leading to the desired leaf. For example:
DBG> EXAMINE voters('salem',ward2) |
If you examine a TREEPTR variable, such as cityptr or wardptr, the debugger displays the address of that tree node. You examine what a TREEPTR variable is pointing to as follows:
DBG> EXAMINE cityptr-> |
If you specify a RECORD by name with the EXAMINE command, all components of the RECORD are presented. To examine individual components of the RECORD, specify the full name of each component.
The general format is as follows:
EXAMINE recordname |
EXAMINE recordname.componentname.componentname... |
You examine an OVERLAY in the same way. All components are again
presented; thus, if a four-byte region is a FILL(4), an INTEGER, and a
VARYING STRING(2), the four bytes will be displayed three different
ways.
C.16 Language UNKNOWN
The following subtopics describe debugger support for language UNKNOWN.
C.16.1 Operators in Language Expressions
Supported operators in language expressions for language UNKNOWN follow:
Kind | Symbol | Function |
---|---|---|
Prefix | + | Unary plus |
Prefix | - | Unary minus (negation) |
Infix | + | Addition |
Infix | - | Subtraction |
Infix | * | Multiplication |
Infix | / | Division |
Infix | ** | Exponentiation (VAX specific) |
Infix | & | Concatenation |
Infix | // | Concatenation |
Infix | = | Equal to |
Infix | <> | Not equal to |
Infix | /= | Not equal to |
Infix | > | Greater than |
Infix | >= | Greater than or equal to |
Infix | < | Less than |
Infix | <= | Less than or equal to |
Infix | EQL | Equal to |
Infix | NEQ | Not equal to |
Infix | GTR | Greater than |
Infix | GEQ | Greater than or equal to |
Infix | LSS | Less than |
Infix | LEQ | Less than or equal to |
Prefix | NOT | Logical NOT |
Infix | AND | Logical AND |
Infix | OR | Logical OR |
Infix | XOR | Exclusive OR |
Infix | EQV | Equivalence |
C.16.2 Constructs in Language and Address Expressions
Supported constructs in language and address expressions for language
UNKNOWN follow:
Symbol | Construct |
---|---|
[ ] | Subscripting |
( ) | Subscripting |
. (period) | Record component selection |
^ (circumflex) | Pointer dereferencing |
Supported predefined symbols for language UNKNOWN follow:
Symbol | Meaning |
---|---|
TRUE | Boolean True |
FALSE | Boolean False |
NIL | Nil pointer |
When the language is set to UNKNOWN, the debugger understands all data types accepted by other languages except a few very language-specific types, such as picture types and file types. In UNKNOWN language expressions, the debugger accepts most scalar OpenVMS calling standard data types.
Previous | Next | Contents | Index |