Using Purify options

You can specify Purify options in three places:

What happens when the value assigned to an option in one place conflicts with the value assigned in another place?

The rule is that Purify applies the value that it encounters first:

Note:

Syntax

Use the following rules when specifying Purify options:

% purify -user-path='/usr/home/program /usr/home/program1'

or

% purify -user-path=/usr/home/program:/usr/home/program1

% purify -mail-to-user=chris,pat,kam

-log-file=./%v.plog

Purify writes the log file to the current working directory. If the program is called test, the log file is called ./test.plog.

Option types

Purify supports three types of options: boolean, string, and integer.

Specifying options in the Purify Viewer

To specify options in the Purify Viewer, select Options > Runtime.

The Runtime dialog displays the option values in use for the current program run.

Purify applies the options set in the Viewer on subsequent runs of the program displayed in the Viewer. Options set in the Viewer do not modify either the default values in the program, or the environment variables. When you quit the Viewer and rerun the application, the option values revert to their original settings.

Purify sends the values of options specified in the Viewer to the application during the start-up of your instrumented program. Therefore, you cannot modify options while your program is running.

Prestarting the Viewer

You can use the -view option to prestart the Viewer in order to set options before running a Purify'd program.

% purify -view a.out

This opens an empty Viewer for the program a.out where you can preset options such as suppressions, then open a view file or run a Purify'd program.

To prestart a Viewer on a different screen, type:

% purify -view -display=<other_machine>.0 a.out

Specifying options in environment variables

You can specify any Purify option in the PURIFYOPTIONS and PUREOPTIONS environment variables. Values in PUREOPTIONS apply to Purify, PureCoverage, and Quantify software products. The values specified in PURIFYOPTIONS take precedence over PUREOPTIONS.

Purify applies build-time options specified in environment variables when a Purify'd application is built. Any build-time options on the link line override environment variables.

Purify applies run-time options specified in environment variables when you run the Purify'd program. The environment values in force when you run the program override any defaults specified on the link line.

If an option is specified more than once in an environment variable, Purify applies the first value it sees. To add an overriding value for the -log-file option without changing other options specified, use a command like:

csh:    % setenv PURIFYOPTIONS "-log-file=new $PURIFYOPTIONS"
sh/ksh:  $ PURIFYOPTIONS="-log-file=new $PURIFYOPTIONS"; export\ PURIFYOPTIONS

PUREOPTIONS environment variable

You can use the PUREOPTIONS environment variable to set options that apply to Purify, PureCoverage, and Quantify software products.

For example, if your site has a central shared file that is sourced by all users' .cshrc or .profile files, you can set -cache-dir=alternate/dir in the PUREOPTIONS environment variable to apply to all users.

Specifying options on the link line

You can specify any Purify option on the link line. For example:

purify -cache-dir=$HOME/pcache -always-use-cache-dir $CC ...

Purify applies build-time options to the Purify build command being run.

Purify builds run-time options into the executable so that they become the default values for the Purify'd executable. This is a convenient way to build a program with nonstandard default values for run-time options. For example:

purify -chain-length=12 $CC ...

Note: