Command-Line Options

CV and CVW accept some of the same options for debugging. Table 8.2 summarizes the CodeView command line options.

Table 8.2 CodeView Command-Line Options

Option CV CVW Description

/2 Yes Yes Use two displays
/8 No Yes Use 8514 and VGA displays
/25, /43, /50 Yes Yes Set 25-line, 43-line, or 50-line mode
/B Yes Yes Use black-and-white display
/Ccommands Yes Yes Execute commands
/F Yes No Flip video pages
/G Yes Yes Control snow on CGA displays
/I[[0 | 1]] Yes Yes Trap NMIs and 8259 interrupts
/Ldll No Yes Load DLL or application symbols
/M Yes Yes Disable mouse
/N[[0 | 1]] Yes Yes Trap nonmaskable interrupts
/S Yes No Swap video buffers
/TSF Yes Yes Read or ignore state file

The remainder of this section describes each option in detail.

Use Two Displays (CV, CVW)

Option

/2

The /2 option permits the use of two monitors. The program display appears on the default monitor, while CodeView displays on the secondary monitor. You must have two monitors and two adapters to use the /2 option. The secondary display must be a monochrome adapter.

If you are debugging a Windows application and have an IBM PS/2 with an 8514 primary display and a Video Graphics Adapter (VGA) secondary display, use the /8 option.

Use 8514 and VGA Displays (CVW)

Option

/8

If your system is an IBM PS/2, you can configure it with an 8514 as the primary display and a VGA as the secondary display. To use this configuration, specify the /8 (8514) option on the CVW command line.

If your VGA monitor is monochrome, it is recommended to use the /B (black-and-white) option. The 8514 serves as the Windows screen and the VGA as the debugging screen.

By default, the debugging screen operates in 50-line mode in this configuration. If you specify the /8 option, you can specify /25 or /43 for 25-line or 43-line mode on the debugging screen.

Warning:

Results are unpredictable if you attempt to run non-Windows applications or the DOS shell while you are running CVW with the /8 option.

Set Line-Display Mode (CV, CVW)

Options

/25
/43
/50

If you have the appropriate display adapter and monitor, you can display 25, 43, or 50 lines when you are running CV, and 25 or 50 lines when you are running CVW. The mode you specify is saved in the CURRENT.STS file so that it is still in effect the next time you run CodeView.

If you specify a mode that is not supported by your adapter and your monitor, CodeView displays 25 lines. For example, only the 25-line display mode is available when you are running CVW with an Enhanced Graphics Adapter (EGA).

Use Black-and-White Display (CV, CVW)

Option

/B

When you start CodeView, it checks the kind of display adapter that is installed in your computer. If the debugger detects a monochrome adapter, it displays in black and white; if it finds a color adapter, it displays in color. The /B option tells CodeView to display in black and white even if it detects a color adapter.

If you use a monochrome display or laptop computer that simulates a color display, you many want to disable color. These displays may be difficult to read with CodeView's color display.

You can also customize CodeView's colors by choosing the Colors command from the Options menu. For more information, see “Colors” on page 370.

Execute Commands (CV, CVW)

Option

/Ccommands

You type commands in the CodeView Command window. You can also specify Command-window commands when you start CodeView. The /C option allows you to specify one or more CodeView Command-window commands to be executed upon startup. If you specify more than one command, you must separate each one with a semicolon (;).

If the commands contain spaces or redirection symbols (< or >), enclose the entire option in double quotation marks ("). Otherwise, the debugger interprets each argument as a separate CodeView command-line argument rather than as a Command-window command.

For complete information on CodeView Command-window commands, see Chapter 12, “CodeView Reference.”

Examples

The following example loads CV with CALCPR as the executable file and /p TST.DAT as the program's command line:

CV /CGmain CALCPR /p TST.DAT

Upon startup, CV executes the high-level language startup code with the command Gmain. Since no space is required between the command (G) and its argument (main), there is no need to enclose the option in double quotation marks.

The next example loads CV with CALCPR as the executable file and /p TST.DAT as the program's command line. It starts CodeView with a long list of startup commands.

CV "/C VS &;G signal_lpd;MDA print_buffer L 20" CALCPR /p TST.DAT

CodeView starts with the Source window displaying in Mixed mode (VS &). Then it executes up to the function signal_lpd with the command G signal_lpd. Next, it dumps 20 characters starting at the address of print_buffer with the command MDA print_buffer L 20. Since some of the commands use spaces, the entire /C option is enclosed in quotation marks.

In this example, the command directs CV to take Command-window input from the file SCRIPT.TXT rather than from the keyboard:

CV "/C<SCRIPT.TXT" CALCPR TST.DAT

Although the option does not include any spaces, you must enclose it in quotation marks so that the less-than symbol (<) is read by CodeView rather than by the operating-system command processor.

Set Screen-Exchange Method (CV)

Options

/F
/S

CodeView allows you to move between the output screen, which contains your program display output, and the CodeView screen, which contains the debugging display. In MS-DOS, CodeView can perform this screen exchange in two ways: screen flipping or screen swapping. The /F (flipping) and /S (swapping) options allow you to choose the method from the command line. These two methods are:

Flipping

Flipping is the default for a computer with a graphics adapter. CodeView uses the graphic adapter's video-display pages to store each screen of text. Flipping is faster than swapping and uses less memory, but it cannot be used with a monochrome adapter or to debug programs that use graphic video modes or the video-display pages. CodeView ignores the /F option if you have a monochrome adapter.

Swapping

Swapping is the default for computers with monochrome adapters. It has none of the limitations of flipping, but it is slower than flipping and requires more memory. To swap screens, CodeView creates a buffer in memory and uses it to store the screen that is not displayed. When you request the other screen, CodeView swaps the screen in the display buffer for the one in the storage buffer. When you use screen swapping, the buffer is 16K bytes for all adapters. The amount of memory CodeView uses is increased by the size of the buffer.

Suppress Snow (CV, CVW)

Option

/G

The /G option suppresses snow that can appear on some CGA displays. Use this option if your CodeView display is unreadable because of snow.

Specify Interrupt Trapping (CV, CVW)

Options

/I[[0 | 1]]
/N[[0 | 1]]

The /I option tells CV whether to handle nonmaskable-interrupt (NMI) and 8259-interrupt trapping. The /N option controls only CodeView's handling of NMIs and does not affect handling of interrupts generated by the 8259 chip. The following table summarizes the options and their effects:

Option Effect

/I0 Trap NMIs and 8259 interrupts
/I1, /I Do not trap NMIs or 8259 interrupts
/N0 Trap NMIs
/N1, /N Do not trap NMIs

You may need to force CodeView to trap interrupts with /I0 on computers that CodeView does not recognize as IBM compatible. Using /I0 enables the CTRL+C and CTRL+BREAK interrupts on such computers.

Load Other Files (CVW)

Option

/Ldll
/Lexe

To load symbolic information from a dynamic-link library (DLL) or from another application, use the /L option when you start CodeView. Specify /L for each DLL or application that you want to debug.

When you place a module in a DLL, neither code nor debugging information for that module is stored in an application executable (.EXE) file. Instead, the code and symbols are stored in the library and are not linked to the main program until run time. The same is true for symbols in another application running with Windows. Thus, CVW needs to search the DLL or other application for symbolic information. Because the debugger does not automatically know which libraries to look for, use the /L option to preload the symbolic information.

Example

The following command starts CodeView for Windows:

CVW /LPRIORITY.DLL /LCAPPARSE.DLL PRINTSYS

CVW is used to debug the program PRINTSYS.EXE. CVW loads symbolic information for the dynamic-link libraries PRIORITY.DLL and CAPPARSE.DLL, as well as the file PRINTSYS.EXE.

Disable Mouse (CV, CVW)

Option

/M

If you have a mouse installed on your system, you can tell CodeView to ignore it by using the /M option. You may need to use this option if you are debugging a program that uses the mouse and there is a usage conflict between the program and CodeView.

Nonmaskable-Interrupt Trapping (CV, CVW)

Option

/N

For information on the /N option, see “Specify Interrupt Trapping”.

Set Screen Swapping (CV)

Option

/S

The /S option sets the CodeView screen-exchange method to swapping. For complete information on CodeView screen-exchange methods, see “Set Screen-Exchange Method”.

Toggle State-File Reading

Option

/TSF

The Toggle State File (/TSF) option either reads or ignores CodeView's state file and color files, depending on the Statefileread entry in the CodeView sections of TOOLS.INI. The /TSF option reverses the effect of the Statefileread entry. The Statefileread entry is set to yes by default.

These options have no effect on writing the files. CodeView always saves its state on exit.

The effect of different combinations of Statefileread and /TSF are summarized in the following table:

/TSF Statefileread CodeView Result

Specified y (or omitted) Do not read files
Specified n Read files
Not specified y (or omitted) Read files
Not specified n Do not read files

The state file is CURRENT.STS. The color files are CLRFILE.CV4 for CV and CLRFILE.CVW for CVW.