Invoking CodeWatch

Once the program has been compiled in debug mode and linked, you can use CodeWatch to debug your program.

To invoke CodeWatch from the command line, use the cwcmd command to invoke CodeWatch. The syntax is:

cwcmd [-e]
      [-srcpath [source_directory [:source_directory] ...]]
      [-stbpath [STB_directory [:STB_directory] ...]]
      [-path [directory [:directory] ...]]
      [-usrin filename]
      [-usrout filename]
      [program-name]
      [program-arguments]

where:

-e (echo) Specifies that every debugger command entered echoes back to the terminal.
-srcpath, -stbpath, and -path Specify directory paths to be searched for source and STB files. See Searching for Source and STB Files for more information.
usrin and -usrout Specify files to redirect user program input from or output to, respectively. See Redirecting User Program I/O for more information.
program-name The name of the executable file to be debugged. If the debugger is invoked without a program-name argument, the a.out file in the current directory is used if it exists; otherwise, CodeWatch starts without loading a file for debugging.
program-arguments Command-line arguments to be passed to the program.

To invoke the CodeWatch debugger from any point within your PL/I program, insert a call to the PLITEST built-in into the program. This starts and attaches the debugger. See PLITEST Subroutine for more information on the parameters used to invoke the debugger, and to view a code sample.