Chapter Contents

Previous

Next
Running the Debugger under CMS

General Instructions

This chapter provides specific instructions for running the SAS/C Debugger under CMS. See also Quick Start to Using the Debugger for more general information.


Compiling Your Source Files

Compile each program module that you want to debug with the debug compiler option.

Use the LC370 EXEC to compile your program under CMS. The LC370 EXEC is invoked with one of the following commands:

LC370 filename
<.filetype<.filemode>>
<(options<)> >

This format uses a CMS fileid to specify the input source file. You must specify filename; however, filetype and filemode are optional. The default value for the filetype argument is C. If you specify filetype, you must join it to filename with a period (.). If you do not specify filemode, all accessed disks are searched. If you use filemode, you must join it to filetype with a period.

LC370 ddn:ddname <(member)> <(options<)> >

With the ddn: format, the source file is specified by a DDname that has been defined with a CMS FILEDEF command. If member is used, it refers to a member of an OS/390 partitioned data set (PDS).

LC370 sf:filename<filetype <dirname> <(options<)> >
The sf: format specifies a Shared File System (SFS) fileid. Like the first format, filename is used to specify the source file, and filetype defaults to C. The SFS directory name is specified by dirname, which defaults to a period and selects your home directory. If you choose to specify a dirname, it can be associated with a filemode, in which case the sf: format functions exactly like the first format shown above. It is also possible to assign a logical name, NAMEDEF, to a dirname. NAMEDEFs can be used interchangeably with dirnames.

When you compile a program with debug, a debugger symbol table file is produced. This file outputs to a file with the same filename as the source file and a filetype of DB. The compiler writes its output files (LISTING, TEXT, and debugger symbol table) to different places depending on the command that you issue in order to invoke the LC370 EXEC.

You can compile your program with the sname option as well as the debug option. The sname option is useful if you plan to specify the SECTION-NAME argument in debugger commands and do not want to determine the default section name. debug Option and sname Option describe the debug and sname options. See the SAS/C Compiler and Library User's Guide for additional information.


Linking Your Programs

If it is necessary, link your programs and run COOL by using the COOL EXEC. See the SAS/C Compiler and Library User's Guide for more information.


Invoking the Debugger under CMS

Invoke the debugger by using the following command:

program-name =d <parameters>

program-name is the filename of the MODULE that you want to debug, and parameters are any optional values, such as redirections, run-time options, or values that you want to pass to the program (for example, argv, argc[ ] ).

If you are running the debugger with a VM release that supports the CMS Shared File System (VM/SP Release 6 and later), you can use an environment variable in order to specify a list of directories that you want to search for the debugger symbol table file. Specify the _DB environment variable with the GLOBALV command as follows:

GLOBALV SELECT LC370 SETL _DB directory-list

directory-list is the list of directories that you want to search. You may specify either a dirname or a NAMEDEF when listing a directory that you want to search. The debugger searches the directories that are specified by _DB in the order in which you list them, until it finds the debugger symbol table file. For example, the following command instructs the debugger to search the .C.PROJ1 directory first and then the .C.PROJ2 directory:

GLOBALV SELECT LC370 SETL _DB .C.PROJ1 .C.PROJ2

Keep in mind that the time and date stamps for the object file and the symbol table file must match; otherwise, the debugger does not accept the symbol table. Thus, old symbol tables for newly compiled source files (even if the source file has not changed) are not accepted by the debugger. If you recompile a source file that you plan to debug, you must recompile the file with debug in order to create a new symbol table file that corresponds to the new object file.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.