DMALLOC(1)

πŸ’– DMALLOC(1) β€” General Commands Manual πŸ’–

okay bestie, sit down, we're learning dmalloc, and honestly? it's giving debugging royalty. πŸ‘‘


✨ NAME ✨

dmalloc β€” the program you use to set up the environment for debugging with the dmalloc debugging library. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

dmalloc [options]

πŸ’… DESCRIPTION πŸ’…

so this manual page documents the dmalloc command. it was written for the Debian GNU/Linux distribution, based almost verbatim on the original documentation that ships with the library in GNU Info format β€” peek down below for that, iykyk. πŸ“–

the dmalloc program exists to help you set the environment variable DMALLOC_OPTIONS. here's the tea: it's designed to print the shell commands you'd need to actually make the appropriate changes to your environment. unfortunately β€” and this is the tragic part 😭 β€” it can't make those changes itself. so you gotta pipe its output through the eval shell command, and eval will do the actual commands for you. it's giving middle-man energy but it works.

if your shell has aliasing or macro powers β€” and like, csh, bash, ksh, tcsh, zsh, etc. all do β€” then setting up an alias for dmalloc that does the eval call is highly recommended. Csh/tcsh users (for example) should drop this into their .cshrc file:

alias dmalloc 'eval `\dmalloc -C *`'

Bash and Zsh girlies on the other hand should put this in their .zshrc file:

function dmalloc { eval `command dmalloc -b $*` }

this lets you just run the dmalloc command as dmalloc arguments, no extra steps. slay. πŸ’…

the most basic usage of the program is dmalloc [-bC] tag. the -b or -C flags (pick one, bestie β€” either but not both at a time, we don't do chaos) are for generating Bourne or C shell type commands respectively. dmalloc will try to use the SHELL environment variable to figure out whether it should be generating bourne or C shell commands, but honestly you may just want to explicitly specify the correct flag yourself. main character move: know your shell. ✨

the tag argument should match a line from your run-time configuration file, or it should be one of the built-in tags. if no tag is specified and no other option-commands are used, dmalloc will display the current settings of the environment variable. and ooh, it is useful to specify one of the verbose options when you do that. πŸ‘€

wanna find out the usage for the debug malloc program? try dmalloc --usage-long. that standardized usage message it shows off is one of the many features of the argv library included with this package. it's available via ftp from ftp.letters.com in the /src/argv directory. check argv.info in there for more info. πŸ“‘


πŸŽ€ OPTIONS πŸŽ€

  • -a address β€” sets the addr part of the DMALLOC_OPTIONS variable to address (or alternatively address:number).
  • -b β€” output Bourne shell type commands.
  • -C β€” output C shell type commands.
  • -c β€” clear/unset all of the settings that weren't specified with other arguments. heads up: clear will never unset the debug setting. use -d 0 or a tag to none if you want to achieve that.
  • -d bitmask β€” sets the debug part of the DMALLOC_OPTIONS env variable to the bitmask value, which should be in hex. this gets overridden (and honestly becomes unnecessary) if a tag is specified.
  • -D β€” list all of the debug-tokens. useful for finding a token to use with the -p or -m options. use it with -v or -V verbose options.
  • -e errno β€” print the dmalloc error string that corresponds to the error number errno.
  • -f filename β€” use this configuration file instead of the RC file ~/.dmallocrc.
  • -i number β€” set the checking interval to number.
  • -k β€” keep the settings when using a tag. this overrides -r.
  • -l filename β€” set the log-file to filename.
  • -L β€” output the debug-value not in hex but by individual debug-tokens in long form.
  • -m token(s) β€” remove (minus) the debug capabilities of token(s) from the current debug setting or from the selected tag (or -d value). you can specify multiple -m's. πŸ—‘οΈ
  • -n β€” without changing the environment, output the commands that result from the supplied options.
  • -p token(s) β€” add (plus) the debug capabilities of token(s) to the current debug setting or to the selected tag (or -d value). multiple -p's can be specified. βž•
  • -r β€” remove (unset) all settings when using a tag. this is useful when you're returning to a standard development tag and you want the logfile, address, and interval settings to be cleared automatically. and if you want this behavior by default, you can just put it into the dmalloc alias. πŸ™ˆ
  • -s number β€” set the start part of the DMALLOC_OPTIONS env variable to number (alternatively file:line).
  • -S β€” output the debug-value not in hex but by individual debug-tokens in short form.
  • -t β€” list all of the tags in the rc-file. use with -v or -V verbose options.
  • -v β€” give verbose output. especially useful when dumping current settings or listing all of the tags. πŸ—£οΈ

🌈 CURRENT SETTINGS DUMP 🌈

if no arguments are specified, dmalloc dumps out the current settings that you have for the environment variable. for example:

Debug-Flags  '0x40005c7' (runtime)
Address      0x1f008, count = 3
Interval     100
Logpath      'malloc'
Start-File   not-set

with a -v option and no arguments, dmalloc dumps out the current settings in a verbose manner. for example:

Debug-Flags  '0x40005c7' (runtime)
   log-stats, log-non-free, log-blocks, log-unknown,
   log-bad-space, check-fence, catch-null
Address      0x1f008, count = 10
Interval     100
Logpath      'malloc'
Start-File   not-set

look at all those flags, bestie. iconic. 🌟


πŸ‘€ SEE ALSO πŸ‘€

the documentation for the library is in GNU Info format. please check the file /usr/share/info/dmalloc.info.gz for more details. πŸ“š


πŸ“ FILES πŸ“

  • /usr/share/info/dmalloc.info.gz β€” the real documentation for the dmalloc library.
  • ~/.dmallocrc β€” user's configuration file.

πŸ’œ AUTHOR πŸ’œ

this manual page was written by Luis Francisco GonzÑlez <luisgh@debian.org>, for the Debian GNU/Linux system (but may be used by others, we don't gatekeep). the library was written by Gray Watson. please see the copyright file in /usr/share/doc/libdmalloc-dev for details. 🫢


and that's the whole page, periodt. this came to you from the DMALLOC(1) General Commands Manual β€” go debug something and make me proud. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from