HP 3000 Manuals

Debugging [ VIRTUOSO CODE GENERATOR Reference Manual ] MPE/iX 5.0 Documentation


VIRTUOSO CODE GENERATOR Reference Manual

Debugging 

The generator does not perform language-specific checking on the
statements that are generated.  Therefore, even if generation of a module
is successful, errors might still occur at compile-time or run-time.

Thus debugging occurs in two stages:  after generation, for Virtuoso
syntax and logic errors, and after compilation, for compilation or logic
errors.  It is very important that all corrections take place within the
Virtuoso source code, not the generated code.  Otherwise, the error
remains within the Virtuoso source, and future output code will be
generated with the same error.

Make sure that you are specifying the correct System Dictionary, scope,
password, domain, version, and status in the INFO string.  Also make sure
that your scope has access to the entities required.  Errors can occur
due to incorrect or incomplete definitions in the System Dictionary.
Examine the model or macro used and the required and optional definitions
for that model or macro.  Examine the entities and relationships loaded
in the System Dictionary using SDMAIN. You can determine if retrieval of
a definition in the System Dictionary failed by reviewing the generator
listing file.

The trace parameter is another useful tool for debugging Virtuoso source
of textmode COBOL. If trace is ON, then the first eight characters of the
name of macros called or include files inserted during generation are
printed to the output file (GENOUT). (You can specify this parameter in
the generator INFO string or with the #option construct.)  You can
determine the macro or include file which may be causing an error by
examining the macro name or include file name which is printed in columns
73-80 of the output file.

The construct #printkeywords can be very helpful when debugging.  It
displays the current keywords and their values for all scoping levels.
Thus it can be used to verify that the keywords used contain the expected
values.  Refer to Chapter 3 for more information on #printkeywords.

To aid in debugging, here is a list of common user errors:

 *  Forgetting to put "#" before a Virtuoso statement or at the start of
    a continuation line

 *  Forgetting to use the continuation character "&"

 *  Going beyond column 72 in COBOL textmode

 *  Placing the "#" before column 7 in COBOL textmode

 *  Forgetting that the #if compare is case-sensitive.

 *  Opening the System Dictionary with the wrong scope, version, and/or
    domain

 *  Missing System Dictionary definitions

 *  Scoping problems (keyword does not exist where expected)

 *  Syntax errors, such as missing quote marks (" ")

 *  Placing a "#" on a user text line

 *  Failure to match #if/#endif or #for/#endfor

 *  Using a COBOL "END-IF" instead of the Virtuoso #endif

 *  File equating to the wrong System Dictionary

Finally, remember that in some cases the syntax of a Virtuoso statement
is checked even if it is not executed.  The generator always checks for
unmatched #block/#endblock, #if/#else/#endif, and #for/#endfor
constructs, even when the lines involved are not executed.



MPE/iX 5.0 Documentation