Well, actually, it's still quite mysterious, but I figured out how to use Purify (thanks to a succinct but helpful tip from the CSL question answerers):
To run your code with Purify memory checking, you must link your compiled object files (.o) through the Purify annotater. First, make sure all your code is compiled via the usual procedures. Then go to the microbase directory within the microbase directory (yes, I know that sounds redundant):
cd $MICROBASE_ROOT/microbaseThen do:
make pmicrobaseThis tells make to run a different command to link your object files than normal make would run. (See Lines 38-39 of the Makefile in this directory if you're curious.)
To see the new functionality, run the newly linked executable:
./pmicrobaseFor example, you could run the component tests for the buffer manager. Purify will watch the executing code and generate output whenever it (the code) does something fishy with memory. Purify's output will be saved to a log file (pure.log) in the same directory. You can open this file and see what it says.
Cool, huh? (Yes, I know, I'm a big nerd.) But I find Purify much easier to understand through its graphical interface. To enable this, we have to mess with the Makefile in this directory, so it's wise to back it up first:
cp Makefile Makefile.bakThen open Makefile with your editor of choice. We'll be editing the line that begins with "PURE_OPTS = " (Line 6 or so). Find the text that reads "-windows=no" and change it to read "-windows=yes". Save your changes, repeat Steps 1 and 2, and behold as Purify launches a new window. Microbase's normal output text will appear in two places: the terminal, where it always has (and where you still have to enter your Microbase commands), and this new window. What makes this new window more interesting? It also includes Purify's output: a little interjection warning you about each suspicious memory usage. Each Purify warning should have a drop-down arrow by it whence you can get more information on what's happening, including which files and line numbers contain the offending code, and an explanation of what Purify thinks is wrong.
When you make changes to your code and want to run this new code with Purify, just recompile all the code as you normally would and do make pmicrobase again as in Step 1, followed by Step 2.
You may be confused by what Purify has to say. Or you may not have even been able to get Purify to say anything. In either case, feel free to email me or come to my office hours. A few errors that I might comment on:
If you want to understand a little more about how to use Purify (instead of just letting make take care of it all), see the CSL's FAQ page. For a lot more information, including a description of all the command-line options available, see:
man purify