Annotating Purify output

You can annotate Purify's output in order to help reproduce a particular run, track down an error, or relate events or phases in your program to error messages. You can also record environmental or situational details into a log file or view file to help decode the results of a test run.

For example, you can record the current directory name and the command line arguments into a log file or view file when running a batch of tests. This allows you to see how to repeat a particular run of your program if that particular run generated an error.

In an interactive program, you might record the commands issued by the user into Purify's output in order to identify the user interactions that triggered the Purify messages.

You can use these functions to annotate Purify's output:

Each of these functions takes a format string and a variable number of arguments, just like printf.

Purify provides partial support for the % conversion syntax of printf. You can use the simple conversion characters %d, %u, %n, %s, %c, %e, %f, or %g. No field width or precision specifiers are allowed, however, and the %e, %f, %g conversion characters are equivalent to %10.2f.

You can also annotate Purify output by using the option -copy-fd-output-to-logfile. The option's value is a list of file-descriptor numbers, for example: 1,2. This causes Purify to interleave all output written to file descriptors 1 and 2 with the Purify output.