Previous | Contents | Index |
Supported constructs in language and address expressions for PL/I follow:
Symbol | Construct |
---|---|
( ) | Subscripting |
. (period) | Structure component selection |
-> | Pointer dereferencing |
Supported PL/I data types follow:
PL/I Data Type | Operating System Data Type Name |
---|---|
FIXED BINARY | Byte- (B), Word- (W), or Longword- (L) Integer |
FIXED DECIMAL | Packed Decimal (P) |
FLOAT BIN/DEC | F_Floating (F) |
FLOAT BIN/ DEC | D_Floating (D) |
FLOAT BIN/DEC | G_Floating (G) |
BIT | Bit (V) |
BIT | Bit Unaligned (VU) |
CHARACTER | ASCII Text (T) |
CHARACTER VARYING | Varying Text (VT) |
FILE | (None) |
Labels | (None) |
Pointers | (None) |
Arrays | (None) |
Structures | (None) |
Variables of the following storage classes are allocated statically:
STATIC
EXTERNAL
GLOBALDEF
GLOBALREF
Variables of the following storage classes are allocated nonstatically (on the stack or in registers):
AUTOMATIC
BASED
CONTROLLED
DEFINED
PARAMETER
The following subtopics give examples of the EXAMINE command with PL/I
data types. They also highlight aspects of debugger support that are
specific to PL/I.
C.13.5.1 EXAMINE Command Examples
The following examples show use of the EXAMINE command with a few selected PL/I data types.
DBG> EXAMINE X PROG4\X: 540.02700 |
DBG> EXAMINE PART MAIN_PROG\INVENTORY_PROG\PART ITEM: "WF-1247" PRICE: 49.95 IN_STOCK: 24 |
DBG> EXAMINE Q MAIN\Q: "666.3330" |
DBG> EXAMINE/HEXADECIMAL P PROG4\SAMPLE.P: 0000B2A4 |
DBG> EXAMINE X PROG\X: "A" |
ALLOCATE X SET (PTR); |
DBG> EXAMINE PTR->X PROG6\PTR->X: "A" |
Note the following points about debugger support for PL/I.
You cannot use the DEPOSIT command with entry or label variables or formats, or with entire arrays or structures. You cannot use the EXAMINE command with entry or label variables or formats; instead, use the EVALUATE/ADDRESS command.
You cannot use the EXAMINE command to determine the values or attributes of global literals (such as GLOBALDEF VALUE literals) because they are static expressions. Instead, use the EVALUATE command.
You cannot use the EXAMINE, EVALUATE, and DEPOSIT commands with compile-time variables and procedures. However, you can use EVALUATE and DEPOSIT (but not EXAMINE) with a compile-time constant, as long as the constant is the source and not the destination.
Note that an uninitialized automatic variable does not have valid contents until after a value has been assigned to it. If you examine it before that point, the value displayed is unpredictable.
You can deposit a value into a pointer variable either by depositing another pointer's value into it, thus making symbolic reference to both pointers, or by depositing a virtual address into it. (You can find out the virtual address of a variable by using the EVALUATE/ADDRESS command, and then deposit that address into the pointer.) When you examine a pointer, the debugger displays its value in the form of the virtual address of the variable that the pointer points to.
The debugger treats all numeric constants of the form n or n.n in PL/I language expressions as packed decimal constants, not integer or floating-point constants, in order to conform to PL/I language rules. The internal representation of 10 is therefore 0C01 hexadecimal, not 0A hexadecimal.
You can enter floating-point constants using the syntax nEn or n.nEn.
There is no PL/I syntax for entering constants whose internal
representation is Longword Integer. This limitation is not normally
significant when debugging, since the debugger supports the PL/I type
conversion rules. However, it is possible to enter integer constants by
using the debugger's %HEX, %OCT, and %BIN operators, because nondecimal
radix constants are assumed to be FIXED BINARY. For example, the
EVALUATE/HEXADECIMAL 53 + %HEX 0 command displays 00000035.
C.14 Language UNKNOWN
The following subtopics describe debugger support for language UNKNOWN.
C.14.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 | & | 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.14.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.
This appendix contains the source code for the programs used in many
figures of Chapter 8, Chapter 9, and Chapter 10,
EIGHTQUEENS.C AND 8QUEENS.C. These programs are presented here only to
assist in understanding the procedures described in those chapters.
D.1 EIGHTQUEENS.C
Example D-1 contains EIGHTQUEENS.C, the single-module program that solves the eightqueens problem.
Example D-1 Single-Module Program EIGHTQUEENS.C |
---|
extern void setqueen(); extern void removequeen(); extern void trycol(); extern void print(); int a[8]; /* a : array[1..8] of boolean */ int b[16]; /* b : array[2..16] of boolean */ int c[15]; /* c : array[-7..7] of boolean */ int x[8]; /* Solve eight-queens problem */ main() { int i; for (i=0; i <=7; i++) a[i] = 1; for (i=0; i <=15; i++) b[i] = 1; for (i=0; i <=14; i++) c[i] = 1; trycol( 0 ); } /* End main */ void trycol( j ) int j; { int m; int safe; m = -1; while (m++ < 7) { safe = (a[m] ==1) && (b[m + j] == 1) && (c[m - j + 7] ==1); if (safe) { setqueen(m, j); x[j] = m + 1; if (j < 7) trycol(j + 1); else print(); removequeen(m, j); } } } /* End trycol */ void setqueen(m, j) int m; int j; { a[m] = 0; b[m + j] = 0; c[m - j + 7] = 0; } /* End setqueen */ void removequeen(m, j) int m; int j; { a[m] = 1; b[m + j] = 1; c[m - j + 7] = 1; } /* End removequeen */ void print() { int k; for (k=0; k<=7; k++) { printf(" %d", x[k]); } printf("\n"); } /* End print */ |
D.2 8QUEENS.C
8QUEENS.C is the multiple-module program that solves the eightqueens
problem. This program consists of two modules, 8QUEENS.C
(Example D-2) and 8QUEENS_SUB.C (Example D-3).
Example D-2 Main Module 8QUEENS.C |
---|
extern void trycol(); int a[8]; /* a : array[1..8] of boolean */ int b[16]; /* b : array[2..16] of boolean */ int c[15]; /* c : array[-7..7] of boolean */ int x[8]; main() /* Solve eight-queens problem */ { int i; for (i=0; i <=7; i++) a[i] = 1; for (i=0; i <=15; i++) b[i] = 1; for (i=0; i <=14; i++) c[i] = 1; trycol(0); printf(" Solved eight-queens problem!\n"); } /* End main */ |
Example D-3 Submodule 8QUEENS_SUB.C |
---|
extern int a[8]; extern int b[16]; extern int c[15]; extern void setqueen(); extern void removequeen(); extern void print(); int x[8]; void trycol( j ) int j; { int m; int safe; m = -1; while (m++ < 7) { safe = (a[m] ==1) && (b[m + j] == 1) && (c[m - j + 7] ==1); if (safe) { setqueen(m, j); x[j] = m + 1; if (j < 7) trycol(j + 1); else print(); removequeen(m, j); } } } /* End trycol */ void setqueen(m, j) int m; int j; { a[m] = 0; b[m + j] = 0; c[m - j + 7] = 0; } /* End setqueen */ void removequeen(m, j) int m; int j; { a[m] = 1; b[m + j] = 1; c[m - j + 7] = 1; } /* End removequeen */ void print() { int k; for (k=0; k<=7; k++) { printf(" %d", x[k]); } printf("\n"); } /* End print */ |
Index | Contents |