Purify

  • how to use purify
    #> setenv PURIFYOPTIONS "-chain-length=40 -cache-dir=/tmp"
    #> make LD="purify g++"
  • get Purify release
    #> purify -version
  • displays Purify options
    #> purify -options
  • display the Purify options used to generate the binary
    #> purify_what_options <binary>
  • workaround to see the code lines with Purify 5.3 on Solaris 8
    CC -xs -g
  • options:
    -follow-child-processes=yesfollow and check the child processes (this is not the case by default)
    -chain-length=40specifies the number of recorded stack frames (default 6)
    -cache-dir=/tmpspecifies the cache directory
    -always-use-cache-dirstores purified files in cache directory instead of alongside original ones
  • by default Purify does not log alarm signals, to log them
    -handle-signals=SIGALRM
  • display a message in the Purify window if the program is tested with Purify, in stderr otherwise
    Create a file purify_stub.c
    // default routines definition (necessary to be able to link without Purify)
    extern "C" int purify_is_running(void);
    extern "C" int purify_printf_with_call_chain(const char *fmt,…);
    int purify_is_running() { return 0;}
    int purify_printf_with_call_chain(const char*,…) { return 0;}
    Use it in your code
    …
    extern "C" int purify_is_running(void);
    extern "C" int purify_printf_with_call_chain(const char *fmt,…);
    …
    if (purify_is_running()) {
        purify_printf_with_call_chain("%s",message);
    } else {
        printf(stderr,"%s",message);
    }

See also: links
Last update: October 25th, 2010
🧭
✉️
🔎