Chapter Contents

Previous

Next
Using the Debugger in a Cross-Development Environment

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 specifies a search list that consists of one or more filename templates. Each filename template specifies a location that is used by the debugger to search for source, include, or debugger files that are associated with the load module that is being debugged. The debugger traverses the search list, looking for the file that is 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 debugger's performance when accessing debugger files. The benefit is especially noticeable when debugger files are large. This command uses a filename template that specifies the primary location to save files and search for 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, see Accessing Remote File Systems.  [cautionend]


Locating the Debugger File

When load modules are generated from objects that are compiled by the SAS/C compiler, the load modules contain filename information for the debugger file. The format of this filename information depends on the host that performs the compilation and the file system in which the debugger file is created. When debugging a program that was compiled by the SAS/C Cross-Platform Compiler, the debugger looks 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 location in the debug search list, as specified by the set search debug command

  3. the original filename that was used by the compiler to open the file when it was created

  4. the filename that was used by the compiler 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 in order 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 attempts to find the debugger file by using any filename templates that are defined in the debug search list. Under OS/390, the debugger's default search list for debugger files is equivalent to the following 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]

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

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

If the debugger file is not found by using the debug search list, then the debugger attempts to open a file with the name that the compiler used when it created the file.

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


Locating Source Files

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

  1. any location in the source search list, as specified by the set search source command

  2. the original filename that the compiler used to open the file when it was created

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

Under OS/390, the debugger's default search list for source files is equivalent to the following command:

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

If a file is not found by using one of the templates in the source search list, the debugger attempts to open a file with the name that the compiler used for the file. Finally, the debugger attempts to open a file with the name that the compiler used when it created the file, together with 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 specify 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 in order to specify a new source search list:

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 that are used to compile your program. The different types of include files each have a separate search list. The debugger looks for an include file in the following locations, in the order listed:

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

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

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

You can use the following forms of the set search command in order to specify a new search list:

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.