<<<<<<<<<<<<<<<<<

purify(prog_tools) Programming Tools purify(prog_tools)

NAME

purify -- an interface to the Purify(TM) debugging routines

DESCRIPTION

The "purify" class is an interface to the routines linked in with a purified lymb executable to monitor heap allocation and memory leaks. The messages described here have no effect on an executable built without Purify.

Currently, Purify works only on the sun4 architecture. To build a purified executable, you must first set your PURIFYHOME environment variable to the directory in which Purify has been installed (e.g. /usr/local/purify). Then, in your <user>.make file, include the line

LOAD = purify cc

in the architecture specific section for the sun4.

SUPERCLASS

object

INSTANCE VARIABLES

none

MESSAGES

new_leaks! Print out memory leaks that have occurred since last new_leaks! message.

all_leaks! Print out all current memory leaks.

clear_leaks! Finds leaks and marks them reported so new_leaks! won't print them out.

new_inuse! Print out list of heap memory allocated since last new_inuse! message.

all_inuse! Print out list of all allocated heap memory.

clear_inuse! Finds heap memory in use and marks it as found.

start_batch! Enables batch mode error reporting

stop_batch! Disables batch mode

start_batch_show_first! Enables batch mode, but immediately displays the first occurrence of each error

new_reports! Print all new reports queued up in batch mode since the last new_reports! message

all_reports! Print all reports in the batch

clear_reports! Clears any new reports in the batch since the last new_reports! or clear_reports!

watch:(addr,[size],[type]) Installs a watchpoint at "addr", which may be specified as a hexadecimal integer or a generic pointer type returned by some other method. Size is a numeric value and indicates how many bytes to watch for at that address. Type is a string containing either "r", "w", or "rw" to indicate the types of operations being flagged.

watch_info! List the active watchpoints.

watch_remove:(watchno,...) Removes the watchpoint specified by each "watchno" in the arg list.

watch_remove_all! Removes all watchpoints.

describe:(addr) Prints details about the memory pointed to by "addr".

what_colors:(addr,[size]) Prints out memory state of size bytes starting at addr. Size defaults to 1. R specifies Red (inaccessable), Y specifies Yellow (uninitialized), G specifies Green (initialized), and B specifies that a watchpoint has been set on that address.

is_running? Returns 1 if the executable is purify'd, 0 otherwise.

assert_readable:(addr,[size]) Tests to see if range of memory is accessible and

initialized. Size defaults to 1.

Returns the result (0 or 1) of the last "assert_readable:" operation.

Tests to see if the range of memory is accessible. Size defaults to 1.

Returns the result (0 or 1) of the last "assert_writable:" operation.

EXAMPLE

purify new_leaks!; /* yes, it's that simple */

SEE ALSO

Purify 2 User's Guide, Purify Quick Reference


Please send comments and suggestions to
consult@rpi.edu