TABLES [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation
HP Pascal/iX Reference Manual
TABLES
TABLES is an HP Pascal Option.
When the TABLES compiler option is ON (and the LIST option is also ON),
the listing includes an identifier map for each compilation block.
Syntax
$TABLES {ON }$
{OFF}
Default OFF.
Location Anywhere.
In order for the listing to contain a table of a specific compilation
block, the TABLES and LIST options must be ON when the compiler finishes
parsing that block.
The table for a compilation block shows each identifier that the block
declares and its class, type, and address or constant value. This
information helps you debug your program.
The information in a table is arranged in four columns, as follows:
Col. Content
1 Alphabetical list of the identifiers accessible to the
current compilation block. If an identifier is the name of
a record type, its field names appear beneath it, indented.
2 The class of the identifier in column one. The classes of
identifiers are: USER DEFINED, CONSTANT, VARIABLE, FIELD,
FUNCTION, TAG FIELD, PARAMETER, and PROCEDURE. For nonlocal
references, the classes NON LOC VAR, NON LOC PARM, and NON
LOC FUNC are used for nonlocal variables, nonlocal
parameters, and nonlocal function returns, respectively.
3 The type of the identifier in column one. The types of
identifiers are: INTEGER, SHORT INTEGER, REAL, BOOLEAN,
SUBRANGE, ENUMERATED, BIT16, LONGREAL, CHAR (character)
VALUE, CHAR ARRAY, STRING LITERAL, ARRAY, RECORD, SET,
FILE, and POINTER.
4 The address or constant value of the identifier in column
one.
Addresses of variables and parameters are of the
form REG+offset, where offset has the format
byte_offset.bit_offset (both byte_offset and bit_offset are
hexadecimal). REG is one of these four values:
Value Meaning
DP+ for global variables
SP- for local variables
PSP- for parameters
name for global variables whose locations cannot be determined
at compile time (for example, module globals and globals in
GLOBAL/EXTERNAL compilation units). No offset is printed
in this case.
The meanings of the four REG values are as follows.
Value Meaning
DP+
The offset is relative to the contents of the DP register
(the "Data Pointer," register 27). This register points to
the base of the global variables. Its value can be
displayed in an assembly-level debugger.
SP-
The offset is a negative offset from the contents of the SP
register (the "Stack Pointer," register 30). This register
points to the top of the activation record of the currently
executing routine. Its value can be displayed in an
assembly-level debugger.
PSP-
The offset is a negative offset from the contents of the
Stack Pointer (SP register) for the caller's frame (the
"Previous Stack Pointer"). Its value can be displayed by
stopping the program at the first instruction of the
current routine and examining the contents of the SP
register before it is incremented to accommodate the frame
of the current routine.
name The compiler cannot determine the location of the variable
at compile time. Instead, it generates a symbol in the
object file for the variable, and the link editor resolves
the references at link time.
On HP-UX, you can display the actual location of such a
variable with the assembly-level debugger adb, which allows
you to specify the variable by name (rather than by
address.)
On MPE/iX, request that the link editor produce a symbol
map of the program file with the command
listprog programfile; data
Function return values are indicated by the class FUNCTION
and the "address" RETURN.
Nonlocal (neither local nor global) variables, parameters
(of enclosing routines), and function returns (of enclosing
functions) are indicated by the address LEVEL n, where n is
the level of the routine that contains the declaration of
the variable or parameter in question.
The address of a FIELD or TAG FIELD is in the format
offset @ length, where offset is in the format
byte_offset.bit_offset, and length is in the format
byte_length.bit_length. The values byte_offset,
bit_offset, byte_length, and bit_length are hexadecimal.
The ADDRESS/VALUE column that TABLES ON produces provides packing
information.
Example
0 1.000 0 $TABLES ON$
0 2.000 0 PROGRAM show_map (input,output);
0 3.000 0 CONST
0 4.000 0 realnum = 19.9;
1 5.000 0 maxsize = 100;
2 6.000 0 title = 'Customer list';
3 7.000 0 TYPE
3 8.000 0 answer = (yes,no);
4 9.000 0 rec = RECORD
5 10.000 0 ch : char;
6 11.000 0 CASE tag : answer OF
7 12.000 0 yes : (message : PACKED ARRAY [1..20] OF char);
8 13.000 0 no : (i : integer);
9 14.000 0 END;
9 15.000 0 VAR
9 16.000 0 customer : rec;
10 17.000 0
0 18.000 0 PROCEDURE proc1 (VAR num : real);
2 19.000 0 VAR
2 20.000 0 debt : Boolean;
3 21.000 0
3 22.000 0 PROCEDURE subproc1;
4 23.000 1 BEGIN
4 24.000 1 IF debt THEN writeln;
6 25.000 1 END;
I D E N T I F I E R M A P
IDENTIFIER CLASS TYPE ADDRESS/VALUE
DEBT NON LOC VAR BOOLEAN LEVEL 1
LOCAL STORAGE USED = 0 TEMPORARY STORAGE USED = 0
PARAMETER STORAGE USED = 0 CONSTANT STORAGE USED = 0
6 26.000 1 BEGIN
6 27.000 1 END;
**** WARNING # 1 "DEBT" ACCESSED, BUT NOT INITIALIZED (535)
I D E N T I F I E R M A P
IDENTIFIER CLASS TYPE ADDRESS/VALUE
DEBT VARIABLE BOOLEAN SP- 28.0 (1.0)
NUM PARAMETER REAL PSP- 24.0 (4.0)
SUBPROC1 PROCEDURE
LOCAL STORAGE USED = 1 TEMPORARY STORAGE USED = 0
PARAMETER STORAGE USED = 4 CONSTANT STORAGE USED = 0
0 28.000 0 FUNCTION func1 : integer; EXTERNAL;
0 29.000 0
10 30.000 1 BEGIN
10 31.000 1 END.
I D E N T I F I E R M A P
IDENTIFIER CLASS TYPE ADDRESS/VALUE
ANSWER USER DEFINED ENUMERATED
CUSTOMER VARIABLE RECORD DP+ 8.0 (18.0)
FUNC1 FUNCTION
INPUT PARAMETER FILE input (248.0)
MAXSIZE CONSTANT INTEGER 100
NO CONSTANT ENUMERATED 1
OUTPUT PARAMETER FILE output (248.0)
PROC1 PROCEDURE
REALNUM CONSTANT REAL 1.99000E+01
REC USER DEFINED RECORD MAX RECORD SIZE = C0 BITS
CH FIELD CHAR VALUE 0.0 @ 1.0
TAG TAG FIELD ENUMERATED 1.0 @ 1.0
MESSAGE FIELD ARRAY 4.0 @ 14.0
I FIELD INTEGER 4.0 @ 4.0
TITLE CONSTANT STRING LITERAL 'Customer list'
YES CONSTANT ENUMERATED 0
GLOBAL STORAGE USED = 18 TEMPORARY STORAGE USED = 0
PARAMETER STORAGE USED = 0 CONSTANT STORAGE USED = 0
MPE/iX 5.0 Documentation