Microsoft KB Archive/80291

= Microsoft Knowledge Base =

CodeView 3.14 Ignores Breakpoints/Step in Overlayed Modules
Last reviewed: January 12, 1995

Article ID: Q80291

SUMMARY
CodeView version 3.14 (supplied with Basic Professional Development System [PDS] version 7.1) will allow you to set breakpoints in overlayed modules, but it ignores those breakpoints at run time. Also, CodeView 3.14 will not step (F8) into an overlayed module. If you press F8 (single step) to step into an overlay module, it will also fail; the code for the overlay routine will be executed and CodeView will step to the next line in the current module.

This information applies to Microsoft Basic PDS version 7.1 for MS-DOS and MS OS/2.

MORE INFORMATION
A customer reported that he could use CodeView 3.14 to step into his overlay modules created in PDS 7.1 when he linked the program with the .RTLink linker. &quot;.RTLink&quot; is a third-party linker made by Pocket Soft, Inc., that claims to provide overlay support for QuickBasic versions 4.x, and enhanced overlay support for Microsoft Basic Professional Development System (PDS). For more information, query on the following words in the Microsoft Knowledge Base:

RTLink and Basic To show the limitation when you link with the Microsoft linker, create the CVA.BAS and CVB.BAS programs and follow the steps below:

CVA.BAS
DECLARE SUB Sub1 DECLARE SUB Sub2  CLS PRINT &quot;This is the main module&quot; CALL Sub1

SUB Sub1

PRINT &quot;Now I am in module 1, Sub1&quot; CALL Sub2 END SUB

CVB.BAS
SUB Sub2

PRINT &quot;Now I am in module 2, Sub2&quot; END SUB

Steps
  Compile CVA.BAS and CVB.BAS with CodeView information: BC CVA /O/Zi; BC CVB /O/Zi;   Link together CVA.OBJ and CVB.OBJ, with CVB.OBJ as an overlay: LINK /CO CVA (CVB); The warning &quot;L4047 - Multiple code segments in module of overlayed program incompatible with /CODE&quot; may occur when linking this program. This warning occurs because of the structure of the Basic PDS run-time libraries, and will not prevent a successful link. For more information on this message, query on the following words: L4047 and LINKER  Load CVA.EXE under CodeView version 3.14 and place a breakpoint on the PRINT statement in Sub1 of CVA.BAS. From the File menu, choose Load Module, and load CVB.BAS. Set a breakpoint on the PRINT statement in Sub2 of CVB.BAS. Press F5 to run CVA.EXE.

Notice that the breakpoint in the non-overlayed Sub2 works normally, suspending program execution until F5 is pressed again to continue. However, the breakpoint on the PRINT statement in CVB.BAS is ignored, and the run completes with a &quot;Program terminated normally (0)&quot; message. Attempting to step into module CVB with F8 will also fail. When CVA and CVB are linked together without making CVB.OBJ an overlayed object, the breakpoint set on the PRINT statement in CVB.BAS works normally, and the program suspends execution twice, as expected.