Dmalloc Logo
Home

Documentation
Downloads
Forums
Releases

Search this site:

Donations:
If dmalloc has saved you or your company time or money, please use your credit-card or PayPal account to donate to the cause.

Dmalloc Tutorial: 4.5 Format of the Runtime Configuration File
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5 Format of the Runtime Configuration File

By using a RC File (or runtime configuration file) you can alias tags to combinations of debug tokens. See section Description of the Debugging Tokens.

NOTE: For beginning users, the dmalloc program has a couple of tags built into it so it is not necessary for you to setup a RC file:

runtime

Enables basic runtime tests including fence-post checking, null handling, and logging of any errors.

low

Runtime settings plus minimal checking of heap structures and overwriting of allocated and freed space.

medium

Low settings plus checking of all heap structures on each memory call, always relocates block on realloc, and aborts on errors. You may want to use -i option to the dmalloc utility. See section Dmalloc Utility Program.

high

Medium settings plus checking of overwritten freed and allocated memory and checking of arguments to a number of common functions. You may want to use -i option to the dmalloc utility. See section Dmalloc Utility Program.

For expert users, a sample `dmallocrc' file has been provided but you are encouraged to roll your own combinations. The name of default rc-file is `$HOME/.dmallocrc'. The `$HOME' environment variable should be set by the system to point to your home-directory.

The file should contain lines in the general form of:

 
tag     token1, token2, …

`tag' is to be matched with the tag argument passed to the dmalloc program, while `token1, token2, …' are debug capability tokens. See section Dmalloc Utility Program, Description of the Debugging Tokens.

A line can be finished with a `\' meaning it continues onto the next line. Lines beginning with `#' are treated as comments and are ignored along with empty lines.

Here is an example of a `.dmallocrc' file:

 
#
# Dmalloc runtime configuration file for the debug malloc library
#

# no debugging
none    none

# basic debugging
debug1  log-stats, log-non-free, check-fence

# more logging and some heap checking
debug2  log-stats, log-non-free, log-trans, \
        check-fence, check-heap, error-abort

# good utilities
debug3  log-stats, log-non-free, log-trans, \
        log-admin, check-fence, check-heap, realloc-copy, \
        free-blank, error-abort

…

For example, with the above file installed, you can type dmalloc debug1 after setting up your shell alias. See section Dmalloc Utility Program. This enables the logging of statistics, the logging of non-freed memory, and the checking of fence-post memory areas.

Enter dmalloc none to disable all memory debugging features.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Gray Watson on May, 16 2007 using texi2html 1.76.

This work is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.
This page should be W3C Valid XHTML and should work with most browsers.