Methods for Debugging Large Programs Within the 640K DOS Limit

ID Number: Q57941

1.00 1.10 2.00 2.10 2.20 2.30 2.35

MS-DOS

Summary:

Because of the 640K limit under DOS, it is common to run out of memory

when trying to debug large programs with CodeView versions earlier

than 3.0. CodeView versions 2.x require over 200K of RAM, not

including memory required by the program being debugged. In addition,

the symbolic information added by compiling with the /Zi switch

greatly increases the executable size of the program you are trying to

debug.

If you cannot upgrade to CodeView version 3.0 or later, use the

following methods to work around the problems associated with limited

available memory for debugging:

- Include full symbolic information only in those modules that contain

source code that you are currently trying to debug. In other words,

compile only those modules with the /Zi switch. For the other

modules, compile with the /Zd option to put only line number

information in the object files.

- Use overlays to swap parts of your code in and out, even if only

during the development process. You can always link without

overlays once your application is debugged.

- If you have expanded memory, use it by invoking CodeView with the /E

switch. For expanded memory to work properly with CodeView, you

should have LIM EMS 3.2 or (preferably) 4.0. Expanded memory is

used for storing the symbolic information, which can be a large

percentage of your .EXE size.

- Use the CVPACK utility, which is documented in the Update section of

the C 5.1 "Microsoft CodeView and Utilities Software Development

Tools for MS OS/2 and MS-DOS Operating Systems Update" manual.

CVPACK will compress the debug information in the file by removing

duplicate references. Use the /p option to achieve maximum

compression.

To obtain a workable solution, use any combination of the above

methods. If adequate debugging is still impossible, then try one of

the following possibilities:

- Switch to the OS/2 operating system. Depending on how compatible

your application is with protected mode requirements, this method

may be limited with regard to how much real-mode program debugging

you can do.

- Take a look at MagicCV from Nu-Mega Technologies of New Hampshire.

MagicCV requires a 386-based computer because it uses the

virtual-86 mode of the processor to run CodeView in extended

memory. This method reportedly allows CodeView to use about 8K of

conventional DOS memory. It should be noted that Microsoft does not

endorse MagicCV or make any claims as to its usage. The information

is offered only as a potential option. Nu-Mega can be reached by

calling (603) 888-2386.