Simple debug output is written by using Dout, as follows: Dout(dc::notice, "called from " << location_ct(CALL_ADDR)); where the second parameter is allowed to contain '<<' to write any type or object to the debug output stream (a location_ct in this case). The 'dc::fatal' and 'dc::notice' are debug 'channels', which can be turned on or off. The user can create and use any number of custom debug channels, in addition to the default ones. It is also possible to create more than just the default debug output ostream object 'libcw_do', and thus to write output to more than one ostream. Each debug object, representing an ostream, can in turn be separately turned on and off. Run-time access to debug information This information includes the possibility to look up source file and line number locations, and function names. As a result, it is for example possible to write debug output that prints who the caller is of a given function, or to print the name of the current function, even if that function is a complex template. For example, PERSIST : PersistXML::serialize_builtin<std::string>("M_hostname", @0xbfc1f214) is called. Run-time access to memory allocation administration Libcwd keeps an internal administration of memory allocations. This allows one to do things like memory leak checking, printing out an overview of allocated memory (in a very powerful way, allowing one to filter on about anything: regular expressions for library names, function names (demangled or not) and/or time intervals during which allocations were made). The library also provides a few global functions that can be called from within a debugger, like gdb, allowing the developer to quickly find out which allocation a given pointer is pointing at. For example, (gdb) call cwdebug_alloc(0x8a19450) 0x8a19450 points inside a memory allocation that starts at 0x8a19448 start: 0x8a19448 size: 12 type: char** description: Array of commandline arguments passed to libcw_app_ct::options_done_event. location: libcw_app.cc:304 in function: libcw_app_ct::libcw_init(int, char* const*) when: 00:31:09.888760 (gdb) l libcw_app.cc:304 External links Libcwd home page Official reference manual Official tutorial C++ debugging support libraries