Chapter Contents

Previous

Next
Cross-Debugging

Using the Debugger's set Command

The SAS/C Debugger's set command provides two subcommands: set search and set cache . The set search command is used to specify a search list consisting of one or more filename templates. Each filename template specifies a location used by the debugger to search for source, include, or debugger files associated with the load module being debugged. The debugger traverses the search list, looking for the file specified by each filename template.

The set cache command is used in cross-development environments that support a distributed file system, primarily to improve the debuggers performance when accessing debugger files. The benefit is especially noticeable when debugger files are large. This command uses a filename template to specify the primary location to save and search for debugger files. In a typical cross-debugging session, this location would be on the mainframe.

Note:    Frequently, file access problems are caused by an improper mount to the remote file system. If you encounter difficulty with either the set search or the set cache subcommands, refer to Accessing Remote File Systems.  [cautionend]


Locating the Debugger File

Load modules that have been generated from objects compiled by the SAS/C compiler contain filename information for the debugger file. The format of this filename information depends on the host that performed the compilation and the file system the debugger file was created in. When debugging a program compiled by the SAS/C Cross-Platform Compiler, the debugger will look for the debugger file in the following locations in the order listed:

  1. Any cache location, as specified by the set cache command.

  2. Any locations in the debug search list, as specified by the set search debug command.

  3. The original file name the compiler used to open the file when it was created.

  4. The file name the compiler used to open the file when it was created with the SAS/C filename style prefix path: .

The debugger first checks to see if a cache location has been specified. The set cache command uses a filename template to specify a location for the debugger file. For example, the following form of the set cache command could be used to specify a cache location in the CMS file system:

'SET CACHE DEBUG = "%sname dbg370"'

If the debugger file is found in the cache location, that file is opened. If the debugger file is not found in the cache location or the module has been recompiled since the debugger file in the cache location was last copied, the debugger continues to search for the file by performing the remaining steps in the search order. If the debugger file is found, it is then copied to the specified cache location and the new cache file is used.

If no cache location was specified or a debugger file is not found in the cache location, the debugger will attempt to find the debugger file using any filename templates defined in the debug search list. On OS/390 systems, the debugger has a default search list for debugger files which, is equivalent to the command:

set search debug = "//ddn:DBGLIB(%sname)"

Note:    You can create an empty debug search list with a set search debug command of the form: set search debug = "" .  [cautionend]

On CMS systems, no default templates are defined for the debug search list, so you will probably want to define one or more templates. The following form of the set search command can be used to specify a new search list for the debugger file:

'SET SEARCH DEBUG = "cms: %sname db *"'

If the debugger file is not found using the debug search list, then the debugger will attempt to open the file by the name the compiler used when it created the file.

Finally, the debugger will attempt to open a file with the name the compiler used when it created the file and the SAS/C filename style prefix path: .


Locating Source Files

The debugger file contains filename information for the source and alternate source files used to compile your program. The debugger will look for the source file in the following locations in the order listed:

  1. Any locations in the source search list, as specified by the set search source command.

  2. The original file name the compiler used to open the file when it was created.

  3. The file name the compiler used to open the file when it was created with the SAS/C filename style prefix path: .

On OS/390 systems, the debugger uses a default search list for source files, which is equivalent to the following command:

set search source = "//ddn:DBGSRC(%sname)"

If a file is not found using one of the templates in the source search list the debugger attempts to open the file by the name the compiler used for the file. Finally, the debugger will attempt to open a file with the name the compiler used when it created the file, prefixed by the SAS/C filename style prefix path: .

The source search list is not checked for source files that have been altered by a #line preprocessor statement that specified a filename. Instead, the separate altsource search list is used. See file-tag Values for more information on altsource .

You can use the following forms of the set search command to specify a new source search list to be used to locate these files:

set search source = "template1" "template2"...

set search altsource = "template1" "template2"...


Locating include Files

The debugger file also contains filename information for the system include and user include files used to compile your program. The different types of include files each have a separate search list. The debugger will look for an include file in the following locations in the order listed:

  1. Any locations in the associated search list, as specified by the set search systeminclude command or the set search userinclude command.

  2. The original file name the compiler used to open the file when it was created.

  3. The file name the compiler used to open the file when it was created with the SAS/C filename style prefix path: .

You can use the following forms of the set search command to specify a new search list to be used to locate these files:

set search systeminclude =
   "template1" "template2"...

set search userinclude =
   "template1" "template2"...


Chapter Contents

Previous

Next

Top of Page

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