Accessing Source Code

The L command has been enhanced to read source code from the data section of the file containing the object code, unless the Z command has been used to identify the source code.

Identifying Source Code (Z)

After entering the Z command, enter the file name followed by the program name, separated by a space. If file name and program are not specified, it is assumed that the source code is in the data section of the file containing the object code, and that the source code has the same name as the object code. For example, if the source code is in item-ID TESTIT in file BP, type:

*Z BP TESTIT

If the Debugger prompt (*) returns, the command was accepted. If the command is illegal for any reason (misspelling, extraneous spaces, etc.), the message NO SOURCE will be printed.

The Z command not only enables source code listing but also permits the current source line to be printed at half-intensity each time the Debugger is re-entered, or when the ? or $ commands are used.

If the program calls an external subroutine, the Z command can be used again to point to the source code of that subroutine. However, it does not have to be reinvoked each time execution transfers between the program and the subroutine.

NOTE

It is not necessary to use the Z command if the source code exists in the same file as the object code.

Displaying Source Code (L, $, ?)

The L command may be used to read the source code from the data section of the file containing the object code (source code), and then display the source code.

Format

L [n [-m] | *]

Parameter(s)

n

Shows line n in the source code.

n-m

Shows the specified range of lines in the source code.

*

Shows all lines of the source code.

For example, to print out lines 59 through 61:

*L59-61

059      INPUT NAME:

060      IF NAME = "" THEN

061         GOTO EXIT

 

*

In addition to L, the $ and ? commands print out the current line number and the corresponding source line.

The $ and ? commands are identical in function. For example the current line can be shown with:

*$<ENTER> CUST.ENTRY L 59      INPUT NAME: OBJECT VERIFIES

In the example, CUST.ENTRY is the name of the program, L 59 refers to line number 59, and INPUT NAME: is the statement on that line of code.

The source line (INPUT NAME:) will be printed at half-intensity. If the Z command is not used before the $ command, the source code will be omitted.

See Also

Using the mvBASIC Debugger

Debugger Commands: Quick Reference

Fixing a Bug

A Sample Program

Entering the Debugger

Exiting the Debugger

Displaying and Changing a Variable

Using Breakpoints and Tracing

Using Execution Control

Printing Output

Using the Return Stack