HP TOOLSET/XL Enhancement [ COMMUNICATOR 3000/XL XL RELEASE 2.1 ] MPE/iX Communicators
COMMUNICATOR 3000/XL XL RELEASE 2.1
HP TOOLSET/XL Enhancement
by Jan Merrill
Santa Clara Information Systems Division
This version of HP TOOLSET/XL supports the record structure feature of
the HP FORTRAN 77/XL compiler. This article describes an example of the
DISPLAY and MOVE commands in HP TOOLSET/XL for debugging HP FORTRAN 77/XL
programs that contain record structures.
HP FORTRAN 77/XL RECORD STRUCTURES
When you use the DISPLAY or DATATRACE command to display fields of type
RECORD, HP TOOLSET/XL displays the fields within the structure by which
the RECORD is declared. If the RECORD variable contains fields of type
UNION, all the MAPs are displayed.
For example, given the following HP FORTRAN 77/XL program,
program convertType
STRUCTURE /RT/
UNION
MAP
complex*8 cmplx
END MAP
MAP
real*4 realPart
real*4 imagPart
END MAP
END UNION
UNION
MAP
character*1 %fill
character*1 chr
END MAP
MAP
integer*2 ord
END MAP
END UNION
character*1 flag
END STRUCTURE
record /RT/ r
r.cmplx = (8,16)
r.ord = 65
r.flag = 'x'
10 continue
write(6,*) 'convert done'
end
the MOVE and DISPLAY commands of HP TOOLSET/XL produce the following:
>>at 10;resume
>>display r
-->Stmt #0: Var: R
R = STRUCTURE
UNION
MAP
CMPLX = (8.0000000E+00,1.6000000E+01)
END MAP
MAP
REALPART = 8.0000000E+00
IMAGPART = 1.6000000E+01
END MAP
END UNION
UNION
MAP
CHR (1/1) = 'A'
END MAP
MAP
ORD = 65
END MAP
END UNION
FLAG (1/1) = 'x'
END STRUCTURE
>>move 32.0 to r.realPart
-->Stmt #0: Var: R.REALPART = 3.2000000E+01
>>display r.cmplx
-->Stmt #0: Var: R.CMPLX = (3.2000000E+01,1.6000000E+01)
>>move 66 to r.ord
-->Stmt #0: Var: R.ORD = 66
>>display r.chr
-->Stmt #0: Var: R.CHR (1/1) = 'B'
MPE/iX Communicators