The dbg library is a set of C++ utilities to facilitate modern debugging
It has been designed to support defensive programming techniques in modern
C++ code. It integrates well with standard library usage and has been
carefully designed to be easy to write, easy to read and very easy to use.
It provides various constraint checking utilities together with an
integrated error logging facility. These utilities are flexible and
customisable. They can be enabled and disabled at runtime, and in release
builds, dbg library use can be compiled away to nothing.
Rich debugging can only be implemented in large code bases from the outset,
it is hard to retrofit full defensive programming techniques onto existant
code. For this reason it is good practice to use a library like dbg when
you start a new project. By using dbg extensively you will find bugs
quicker, and prevent more insideous problems rearing their head later in
the project's life.
For instructions on the dbg library's use see the @ref dbg namespace
This library was written by Pete Goodliffe and we improved it, we also have a lot of todo item for libdbg.
This library is released under the term of the GNU LGPL licence.
- get the last release :
Use dbg linked with your project (not as a shared library), you just
have to include the files in your project.
Build is simple on any platform. For debugging builds, add a macro
definition of DBG_ENABLED to your compiler (e.g. for gcc add
-DDBG_ENABLED). Add the dbg.cpp file to your build. That's it!
For non-debug builds, don't define DBG_ENABLED, and don't compile dbg.cpp.
- get the debian package : happycoders-libdbg and happycoders-libdbg-dev
add this line to /etc/apt/sources.list :
deb http://debian.speedblue.org ./
Doxygen documentation is available here .