⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wfdebug.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 2 页
字号:
.chap The &product Debugger
.*
.section Description
.*
.np
The execution-time debugger is selected by specifying the "DEBUG"
compiler option.
If there are no source errors in the FORTRAN program, execution of the
program will commence.
The debugger is entered before the execution of the first FORTRAN
statement.
The debugger prompt is "DEBUG>".
The statement that is about to be executed is displayed along with its
internal statement number (ISN).
This information is extracted from the listing file.
If no listing file was created, as would be the case if the "TYPE"
option was specified, a message would be issued by the debugger
indicating it could not open the listing file.
The user may set breakpoints, trace statement execution, and examine
or modify variables.
.*
.section Invoking the &cmpname Debugger
.*
.ix debugger invoking
.ix invoking debugger
.if '&machsys' = 'VM/SP CMS' .do begin
.***************************************
.mbigbox begin
&cmpcmdup. <fn> [<ft>] [<fm>] (DEBUG [<options>]
.mbigbox end
.synote
.note []
The square brackets denote items which are optional.
.note <fn>
is the CMS file name of the file to be compiled.
It also may be the name of a file currently being edited with IBM's
XEDIT editor.
.note <ft>
is the CMS file type of the file to be compiled.
If omitted, a file type of "FORTRAN" is assumed.
.note <fm>
is the CMS file mode of the file to be compiled.
If omitted, a file mode of "*" is assumed.
.note DEBUG
is the option used to select the execution-time debugger.
.note <options>
is a list of other &cmpname options.
.endnote
.exam begin
&cmpcmdup. DEMO (DEBUG
.exam end
.***************************************
.do end
.if '&machsys' = 'DOS' .do begin
.***************************************
.mbigbox begin
&cmpcmdup. /DEBUG [options] [d:][path]filename[.ext] [options]

    or

&cmp2cmdup. /DEBUG [options] [[d:][path]filename[.ext]] [options]

    or (using the integrated editor)

RUN /DEBUG [[options] [d:][path]filename[.ext] [options]]
.mbigbox end
.synote
.note []
The square brackets denote items which are optional.
.note &cmpcmdup.
is the version of &cmpname which does not require the 80x87 numeric
data processor.
.note &cmp2cmdup.
is the version of &cmpname which requires the 80x87 numeric data
processor.
.note DEBUG
is the &cmpname option that selects the execution-time debugger.
.note options
is a list of other &cmpname options, each preceded by a slash.
The list of options may not contain any blank characters.
Options may be specified in any order.
.note d:
is an optional drive specification such as :FNAME.&dr1:eFNAME.,
:FNAME.&dr2:eFNAME., etc.
If not specified, the default drive is assumed.
.note path
is an optional path specification such as
:FNAME.&pc.SRC&pc.PROGRAMS&pc:eFNAME..
If not specified, the current directory is assumed.
.note filename
is the file name of the file to be compiled.
.note ext
is the file extension of the file to be compiled.
If omitted, a file extension of :FNAME.&cxt:eFNAME. is assumed.
If the period "." is specified but not the extension, the file is
assumed to have no file extension.
.endnote
.exam begin
&cmpcmdup./DEBUG DEMO
.exam end
.***************************************
.do end
.if '&machsys' = 'VMS' .do begin
.***************************************
.mbigbox begin
&cmpcmdup./DEBUG[/qualifiers] file-spec-list[/qualifiers]

    or (from EVE)

RUN /DEBUG[/qualifiers] [file-spec-list]
.mbigbox end
.synote
.note []
The square brackets denote items which are optional.
.note /DEBUG
is the qualifier used to select the execution-time debugger.
.note /qualifiers
is a list of other &cmpname options, each preceded by a slash.
.note file-spec-list
specifies the name of one or more VAXTPU buffers or FORTRAN source
files to be compiled.
If you do not specify a file type for a disk file, &cmpname uses the
default file type of "FOR".
.endnote
.exam begin
$ &cmpcmd./debug demo
.exam end
.***************************************
.do end
.if '&machsys' = 'QNX' .do begin
.***************************************
.mbigbox begin
&cmpcmd. +debug [<options>] <file-spec>

    or (using the integrated editor)

run +debug [[<options>] <file-spec>]
.mbigbox end
.synote
.note []
The square brackets denote items which are optional.
.note +debug
is the option used to select the execution-time debugger.
.note <options>
is a list of other &cmpname options, each preceded by a blank.
.note <file-spec>
is the QNX file specification of the file to be compiled.
.endnote
.exam begin
% &cmpcmd. +debug demo
.exam end
.***************************************
.do end
.pc
The above example requests &cmpname to compile and execute the file
:FNAME.demo.&langsuff.:eFNAME..
Before execution of the program begins, the &cmpname debugger is
entered.
.*
.section Debugger Commands
.*
.np
.ix 'debugger commands'
In the following debugger command descriptions, upper case letters
denote short forms for the command and lower case letters may be
optionally specified.
For example, "HELP", "HEL", "HE", "H" (typed in either upper or lower
case letters) are acceptable forms of the "help" command.
.np
Items shown inside square brackets ([]) are optional.
The "or" bar (|) denotes alternate choices for the operand of a
debugger command.
Items shown inside angle brackets (<>) are explained in the command
descriptions.
When specifying such an item, the brackets must not be entered.
.np
The internal statement number or ISN, as it is used below, may be
specified in several ways.
Each executable statement has its own unique ISN.
ISN's are shown to the left of statements in the listing file.
The current statement is the statement which will next be executed
when program execution is resumed.
To refer to the ISN of this statement, you may use the short form ".".
You may refer to other statements by specifying a number with a
preceding "+" or "-" sign.
In this case, the actual ISN is calculated by adding or subtracting
(depending on the sign) the specified number from the ISN of the
current statement.
Alternately, you may specify the actual ISN of the statement or
statements.
.np
Specifically, <isn> may be specified as
.begpoint
.point (a)
a "." (the current ISN),
.point (b)
a negative sign ("-") followed by a number (the current ISN - number),
.point (c)
a positive sign ("+") followed by a number (the current ISN + number),
or
.point (d)
a number.
.endpoint
.*
.beglevel
.*
.section The Breakpoint Command
.*
.np
.ix 'debugger commands' breakpoint
The
.us breakpoint
command is used to set or clear breakpoints.
There are two forms of the
.us breakpoint
command.
The first form sets or displays current breakpoint information.
.mbox begin
Breakpoint [<isn>]
.mbox end
.np
When an ISN is specified, execution of the program will continue until
the specified statement is about to be executed.
If no ISN is specified, the debugger will display the ISN of all the
statements at which breakpoints have been set.
No output is produced if no breakpoints have been set.
.np
The second form clears any breakpoints that have been set.
.mbox begin
Breakpoint /c
.mbox end
.np
.exam begin
DEBUG>b 120
DEBUG>break .
DEBUG>b /c
.exam end
.*
.section The Display Command
.*
.ix 'debugger commands' display
.mbox begin
Display [* | <isn>[:<isn>]]
.mbox end
.np
The
.us display
command is used to display executable FORTRAN statements in the
current program unit.
If no ISN or ISN range is specified, the 5 statements before and after
the current statement about to be executed are displayed.
The current statement is marked by an asterisk in the first column.
.np
In addition, any statement or range of statements may be displayed.
The current statement may be specified as ".".
An ISN range may be specified in absolute terms (e.g., 11:20) or in
terms relative to the current statement (e.g., -5:+22) or in
combinations of both (e.g., 9:+3).
A negative sign ("-") indicates the number of statements before the
current statement and a positive sign ("+") indicates the number of
statements after the current statement.
When no sign is present, the number is assumed to be an ISN.
If "*" is specified then the entire program is displayed.
.exam begin
DEBUG>d
DEBUG>disp 8:22
DEBUG>d .
DEBUG>d -5:+12
DEBUG>d 132:+20
DEBUG>display *
.exam end
.*
.section The Go Command
.*
.ix 'debugger commands' go
.mbox begin
Go [<isn>]
.mbox end
.np
The
.us go
command resumes execution from the point where the program was last
stopped.
Alternatively, an ISN may be specified in which case execution resumes
until the specified ISN is reached.
.exam begin
DEBUG>g
DEBUG>go 12
DEBUG>g -1
DEBUG>g +2
.exam end
.*
.section The Help Command
.*
.ix 'debugger commands' help
.mbox begin
Help
.mbox end
.np
The
.us help
command provides a summary of the debugger commands available and
their options.
.*
.section The Logio Command
.*
.ix 'debugger commands' logio
.mbox begin
Logio [<unit>]
.mbox end
.np
The
.us logio
command can be used to toggle the logging status of all input and
output on a specified unit.
Initially, input and output on a unit is not logged.
To start logging of a unit, specify the
.us logio
command with the number of the unit to be logged.
The log is displayed on the screen.
Formatted records are displayed in
.if '&machsys' = 'VM/SP CMS' .do begin
EBCDIC format.
.do end
.el .do begin
ASCII format.
.do end
Unformatted records are displayed in hexadecimal (base 16) notation.
To stop logging of a particular unit, issue a second
.us logio
command specifying the unit number.
.np
If no unit number is specified, a summary of the units that are being
logged is displayed.
.np
Input records are displayed with a unit number prefix and the
.mono "<"
character (to indicate "input").
Output records are displayed with a unit number prefix and the
.mono ">"
character (to indicate "output").
.exam begin
DEBUG>l 6
DEBUG>logio
.if '&machsys' = 'QNX' .do begin
6    [33]$tty0
.do end
.if '&machsys' = 'VMS' .do begin
6    SYS$OUTPUT
.do end
.if '&machsys' = 'VM/SP CMS' .do begin
6    TERMINAL
.do end
.if '&machsys' = 'DOS' .do begin
6    CON
.do end
DEBUG>l 2
DEBUG>logio 3
DEBUG>g
2<This is record 1
3>This is record 1
2<This is record 2
3>This is record 2
.exam end
.pc
The above example illustrates logging of units 2, 3 and 6.
Two records are read from unit 2 and written to unit 3.
.*
.section The Quit Command
.*
.ix 'debugger commands' quit
.mbox begin
Quit
.mbox end
.np
The
.us quit
command terminates the debugger and returns to the system.
.*
.section The Trace Command
.*
.ix 'debugger commands' trace
.mbox begin
Trace
.mbox end
.np
The
.us trace
command places the program into a mode that causes the debugger to be
re-entered after the execution of a single statement (single-step
mode).
Immediately after specifying the
.us trace
command, the debugger will display a line which presents the user with
a number of options.
.illust begin
Into["I" key]    Over[space bar]    Next["N" key]    Exit["Enter" key]
.illust end
.np
If the "I" key is pressed, the debugger will execute a statement.
If the statement has a reference to a subroutine or function,
execution of the subroutine or function is traced.
Otherwise tracing will continue at the next statement to be executed
in your program.
.np
If the space bar is pressed, the debugger will execute a statement and
continue tracing at the next statement to be executed in your program.
Tracing of subroutines or functions is skipped.
.np
If the "N" key is pressed, tracing will advance to the next sequential
statement immediately following the current statement.
This is particularly useful when you are at the bottom of a loop and
you do not wish to retrace all the statements in the loop.
.*
.section The Unit Command
.*
.ix 'debugger commands' unit
.mbox begin
Unit [<unit>]
.mbox end
.np
The
.us unit
command is used to display information regarding FORTRAN units.
If
.mono <unit>
is omitted, all connected units and their corresponding file
names are displayed.
.if '&machsys' = 'VM/SP CMS' .do begin
.exam begin
DEBUG>unit
1     CUSTOMER REC      A
6     TERMINAL
5     TERMINAL
.exam break
DEBUG>u 1
FILE=   CUSTOMER REC       A
RECL=   80
BLANKS= null
STATUS= unknown
ACCESS= sequential
FORM=   formatted
REC=    1
IOSTAT= 0
.exam end
.do end
.if '&machsys' = 'VMS' .do begin
.exam begin
DEBUG>unit
1     DRB2:[&cmpcmdup..EXAMPLES]CUSTOM.REC;1
6     SYS$OUTPUT
5     SYS$INPUT
.exam break
DEBUG>u 1
FILE=   DRB2:[&cmpcmdup..EXAMPLES]CUSTOM.REC;1
RECL=   132

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -