Created On:  22 October 2012

Problem:

Codewatch will not step through code inserted using %INCLUDE.

Resolution:

At the time of writing (November 2012), the PL/1 debugging tool, Codewatch, cannot always step through code that has been inserted into the program using the %INCLUDE statement.

In particular, if the included code is a PL/1 internal procedure, it is not possible to "step into" the procedure code.

The following workaround may be used to enable the debugging of the entire program, including any inserted code.

Add the following options to your mfplx compilation command:-

-macro           This forces the PL/1 pre-processor (mfpp) to be executed before the compiler (mfpli)
-pp        This tells the pre-processor to save its output in the file identified as (usually called .pp)
-nodebuginfo  This tells the pre-processor to suppress the %LINE and %FILE messages that usually appear in pre-processor output

The resulting output from the PL/1 pre-processor will be PL/1 source code containing the original program source, plus any code that has been inserted using the %INCLUDE statement (both from the original source, and from any %INCLUDE statements embedded within included files), without the usual %LINE and %FILE messages.

When Codewatch is used to step through the compiled program, it will use the .pp file instead of the original source file, and therefore will be able to step through all statements, wherever they originated from.

N.B.#1 - In the absence of the %LINE and %FILE messages, it will not be possible to identify which sections of code were included from external files, unless you clearly document the start and end of each code segment with PL/1 comment statements.

N.B.#2 - Remember to store the .pp file in the folder specified in the codewatch_srcpath environment variable.