• Aucun résultat trouvé

FORTRAN-PLUS code

Dans le document Series DAP (Page 86-90)

psam: step

User-Defined Pause: Number 1 FORTRAN-PLUS Subroutine ADD3 at

In FORTRAN-PLUS programs, for most types of report, the level of detail in a particular report depends on what level of detail was specified for the —D and —d options when dapf and dapopt were run (see section 2.7 on page 32 and section 3.4.7 on page 52, respectively formoredetails).

For example, if you stepped the example program entdap used earlier in the chapter, you should get a display like:

Line 5 in File fadd3.df

Stack Listing - current level first

> FORTRAN-PLUS Function ADD3 at Line 5 in File fadd3.df FORTRAN-PLUS Subroutine ENTDAP at Line 7 in File esdap.df System Procedure MT5XCODE6OlV33

Rgure 4.14 Typical FORTRAN-PLUS diagnostic report

In general, most FORTRAN-PLUS diagnostic reports will contain one or mote of the following items:

(

event-details

FORTRAN-PLUS proc-type proc-name at Line line-number in File source-file-name stack-backtrack

errors

line or procedure variables display-values

source-line

End of Report

where:

. event-details gives details of the event that caused the output of the diagnostic report. A typical entry might be:

Run-Time Error: en-ri-details

C

User-Defined Pause: Number n

Breakpoint n

a-• proc-type is Subroutine orFunction.

• proc-name is the name of the current procedure.

76 manOQ3.04 AMT

4.6: Diagnostic reports 77

• line-number is the line number (in the FORTRAN-PLUS source file) on which execution has stopped (line details are only displayed if the —D option to dapf that was in force was 1 or 2; default is 2).

• source-file-name is the filename of the current FORTRAN-PLUS source file (file details are only displayed if the —D option to dapf that was in force was 1 or 2— the default is 2— and dapf was run under DAP basic software release 3.2 or later).

• stack-backtrack starts with:

[

Stack Listing - current level first

and is a list of all the active procedures.

• errors displays, if a computational error has occurred, the positions of the components causing the last unsuppressed FORTRAN-PLUS computational error (see errors, page 88).

• line or procedure variables displays the values of variables if a computational error occurs and if the parameter to the —d option to dapopt that was in force was not 0 (the default is 0). The variables displayed are thoseonthe failing line(—dl)or inthefailing subprogram as well (—d2).

. display-values is a list of the values of all the variables requested by the psam command display.

• source-code-line is the line of source code on which execution has halted.

stopstatement Reports output by thestopcommand are of the form:

C

User-defined Stop: Number number at Location offset where:

• number is the number associated with the stop in your FORThAN-PLUS source code.

• offset is the instruction offset of the stop instruction in hexadecimal (in DAP words, of 32 bits) from the start of the object code version of yourprogram.

This feature is not of much interest to FORTRAN-PLUS programmers, but is valuable for APAL programmers.

If a STOP statement is executed, program execution stops, and control returns to the host. DAP and host programs are abandoned and psam is not invoked. See DAP Series:

FORTRAN-PLUS enhanced, [2], formoredetails of stop.

DAP Series: Program Development under UNIX manOQ3.04 77

FORTRAN-PLUS trace statement The conditions under which a diagnostic report is produced for a FORTRAN-PLUS trace statement are discussed in section 4.5.2 above. The report is of the form:

(FORTN-PLuS Trace

F0RTRN-PLUS proc-type proc-name at Line line-number in Filesource-file-name values-of-variables-requested-in-trace-statement

of Report

where:

• proc-type is the procedure type, either Subroutine or Function.

• proc-name is the name of the procedure containing the trace statement.

• line-number is the line number in the FORTRAN-PLUS source file of the trace statement.

• values-of-variables-requested-in-trace-statement are the values of the variables specified in the trace statement.

• source-file-name is the name of the file containing the trace statements (no file details are available if dapf was run under DAP basic software release 3.1 or earlier).

All components of specified vectors, matrices and arrays are displayed; you cannottrace any subset of a matrix, vector or array. The FORTRAN-PLUS storage mode appropriate to each variable is assumed by the system, and spurious values will be printed for any variable which is held in incorrect storage mode.

462 Reports

from

APAL code In the APAL assemblerdapa,there is no comparable option to —D in dapf, and all diagnostic reports contain the same level of detail.

APAL diagnostic reports will contain one or more of the following items:

event-details

Procedure proc-name + offset-value stack-backtrack

instructions

End of Report

where:

• event-details gives details of the event that caused the output of the diagnostic report. Atypical entry might be:

78 manOO3.04 AMT

4.6: Diagnostic reports 79

• offset-value is the offset in hexadecimal (from the start of the code section) of the last instruction to be executed before processing halted.

• stack-backtrack starts with:

Stack Listing - current level first

1

and is a list of all the active procedures on the stack.

• instructions are the last APAL instruction to be executed before processing was halted, and the instruction that will be executed when processing is re-started. If the cause of the halt was a breakpoint, then only the second instruction is displayed.

APALtracestatement The conditions under which a diagnostic report is produced for an APAL trace statement were discussed in section 4.5.3 above. The report is of the form:

(APAL Trace

Trace number trace-number

Procedure proc-name +offset-value

I

contents-of-registers-requested-in-trace-instruction

I

values-of-array-store-items-requested-in-trace-instruction

End of Report

where:

• trace-number is the value of the number specified in the trace instruction in your code.

a proc-name is the name of the procedure containing the trace instruction.

• offset is the word offset (in hexadecimal) of the trace instruction, from the start of the procedure.

a contents-of-registers-requested-in-trace-instruction are the contents of the requested MCU, edge and PE registers.

values-of-array-store-items-requested-in-trace-instruction are the contents of the requested array store items.

a proc-name is the name of the current APAL code section.

DAP Series: Program Development under UNIX manOO3.04 79

Dans le document Series DAP (Page 86-90)