Chapter Contents |
Previous |
Next |
An Overview of the SAS/C Debugger |
This section explains the steps necessary to compile, link, and run programs with the SAS/C Debugger under CMS and OS/390. Part 3 of this book, "Using the Debugger in Your Environment," also describes these steps, but it includes more detailed information about using compiler options, allocating data sets that are needed by the debugger, saving a debugger session, setting up a debugger profile, and so on. The quick start procedures that are contained in this section are helpful to a new SAS/C Debugger user. If you are an experienced CMS or OS/390 user, familiar with previous releases of the debugger, see Notes for Users with SAS/C Debugger Experience.
Quick Start to Using the Debugger under CMS |
This CMS
quick-start procedure provides the essential information
that you need in order to start using the debugger under CMS. Detailed information
about compiling and linking your programs is provided in the SAS/C Compiler
and Library User's Guide, Third Edition. Also, once you are comfortable
with running the debugger, you can find more advanced information in Running the Debugger under CMS.
These are the steps to using the debugger under CMS:
This step compiles the source file for program-name with the compiler
debug
option. The name
of the program is program-name C. The compiler
output is placed in a file calledprogram-name
TEXT. The debugger symbol table file is placed inprogram-name DB. (The compiler outputs the debugger symbol table file,
which the debugger uses at run time.)
LOAD program-name |
GENMOD program-name |
This step runs your program. The
=debug
option invokes the debugger.
Note:
Even though you compile with the
debug
option, you must invoke the debugger at run time also.
Quick Start to Using the Debugger under TSO |
Note:
The SAS/C
Debugger can be run in a batch job under OS/390. This procedure is explained
in Running the Debugger under TSO,
and in Running the Debugger under OS/390 Batch.
Before you can compile, link, and debug a program, you must
create two data sets, one to hold your source code and one to hold the debugger
symbol table file that is created when you compile with the
debug
option. The attributes of the data set that holds your source code are not
critical; however, the debugger file does require specific attributes for
record format and blocksize. For the debugger symbol table file, allocate
a partitioned data set (PDS) with RECFM=U and BLKSIZE=4080. For the purpose
of this quick-start procedure, use the data set names userid.pdsname.C and userid.pdsname.DBGLIB, as
recommended in TSO Quick-Start Procedure.
This procedure provides the essential information that you need in order to start using the debugger. Detailed information about compiling and linking your programs is provided in the SAS/C Compiler and Library User's Guide. Also, once you are accustomed to running the debugger, you can find more advanced information in Running the Debugger under TSO.
LC370 MYWORK(HELLO) DEB
The object code output from the compiler is placed in the PDS userid.MYWORK.OBJ(HELLO). Another output (which contains special tables that are used while running the debugger) is placed in the PDS userid.MYWORK.DBGLIB. The member name is the section name (SName).(footnote 1) The debugger uses the section name in order to locate the member that contains debugging information for the compilation. For more information, see SECTION-NAME and FUNCTION-NAME Arguments.
COOL MYWORK(HELLO)
The following ALLOCATE statement allocates userid.MYWORK.DBGLIB:
ALLOC DA(MYWORK.DBGLIB) F(DBGLIB) SHR
The following command runs the program in userid.MYWORK.LOAD(HELLO):
CALL MYWORK(HELLO) '=DEBUG'
The
'=debug'
option invokes the debugger.
The debugger prompts you for the debugger data set name if you omit step 3.
Naming your data sets Name your partitioned data sets (PDSs) as follows:
source data set | userid.pdsname.C |
object data set | userid.pdsname.OBJ |
load data set | userid.pdsname.LOAD |
debugger data set | userid.pdsname.DBGLIB |
userid.MYWORK.C | |
userid.MYWORK.OBJ | |
userid.MYWORK.LOAD | |
userid.MYWORK.DBGLIB |
LC370 'userid.MYWORK.SOURCE(PROGRAM)' DEBUG OBJECT(‚ ‚ ‚ userid.MYWORK.OBJ (PROGRAM)''') DBGLIB(‚ ‚ ‚ userid.MYWORK.DBGLIB (PROGRAM)''')
COOL 'userid.MYWORK.OBJECT(PROGRAM)' LOAD(‚ ‚ ‚ userid.MYWORK.LOAD (PROGRAM)''')
Notes for Users with SAS/C Debugger Experience |
As with previous releases of the software, you invoke the
SAS/C Debugger
by adding the
=debug
option to the command that runs your program.
sname
compiler option.
If no section name is specified, the compiler assigns one as described in
the chapter about compiler options in the SAS/C Compiler
and Library User's Guide.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.