You can specify Purify options in three places:
In the Purify Viewer
In the environment variables PURIFYOPTIONS or PUREOPTIONS
On the link line
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:
At build time, Purify
reads values assigned to build-time options
first from the link line, then from PURIFYOPTIONS,
and last from PUREOPTIONS.
The Viewer is not involved at build time.
At run time, Purify reads values assigned to run-time options first from the Purify Viewer (if it has been started), then from PURIFYOPTIONS, then from PUREOPTIONS; last it reads the values that were specified on the link line when the program was built, and that are now built into the instrumented executable.
You can specify both build-time and run-time options on the link line and in environment variables. Purify applies them at the appropriate times.
If you build with the build-time option -ignore-runtime-environment, your instrumented executable will use only the built-in options, regardless of Purify options specified in the environment.
Use the following rules when specifying Purify options:
Purify options must begin with a hyphen; for example, -leaks-at-exit=no
Purify ignores case, hyphens, and underscores in the option name. For example, the option -leaks-at-exit is equivalent to -LEAKS_AT_EXIT and -LeaksAtExit.
Do not use a space on either side of an equal sign (=).
For options that take a list of directories, use spaces or colons (:) to separate directory names. For example:
% purify -user-path='/usr/home/program /usr/home/program1'
or
% purify -user-path=/usr/home/program:/usr/home/program1
Specify a list of addresses or signals separated by commas (,). For example:
% purify -mail-to-user=chris,pat,kam
You can use wildcards. For example, in filenames: program* matches program4, /dira/dirb/program.o, and /dira/dirb/program1.o.
You can use conversion characters when you specify filenames for options such as -log-file, -watchpoints-file, and -view-file.
If the filename is unqualified (does not contain "/"), Purify writes it to the directory where the program resides. Qualified filenames can be absolute or relative to the current working directory. For example, if you specify the option:
-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.
Purify supports three types of options: boolean, string, and integer.
Boolean options take the values yes or no, or true or false. If you do not specify an explicit value, the value is yes. For example, the option settings -leaks-at-exit and -leaks-at-exit=yes are identical.
String options can be a string of any kind. If you do not specify an explicit value for a string option, the value is cleared. For example, the option -log-file=./pureout routes Purify messages to the file pureout in the current directory. The option -log-file=, without a value, clears any default specification of a logfile.
Integer options can be set to any whole number. For example, the option -chain-length=10 increases the length of the printed function call chains from the default of 7 to 10. A sign is optional. Integer values cannot be cleared.
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.
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
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
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.
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:
To make sure that run-time options you specify remain in effect whenever the executable is run, use the -ignore-run-time-environment option at build time.