The dbg library is a set of C++ utilities to facilitate modern debugging idioms.

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 existent 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 more quickly, and prevent more insidious problems rearing their head later in the project's life.

 


Pete Goodliffe


About dbg dbg

This is the home of the dbg library, a debugging library for C++.

dbg library features include:

  • Expressive constraint checking utilities
  • Integrated stream-based logging facilities
  • Execution tracing support
  • Differentiates between different sources of diagnostics - you can enable/disable them all independently
  • Easy to use, powerful, configurable
  • assertion behaviour can be altered at runtime (abort, throw, or continue)
  • Integrates well with modern C++ code
  • Can be compiled out with no overhead

To see how to use the dbg library, view the on-line documentation below.

Availability dbg

The dbg library is not platform specific, all that is required to use it is a sufficiently standards compliant compiler. dbg has been built on the following compilers:

  • gcc 3.0 - 3.3
  • gcc 2.95.3
  • gcc 2.96
  • Microsoft Visual C++ 6.0
  • Borland C++ 5.5.1

News dbg

2002-07-20 Version 1.20
gcc 3.3 support. Bug fixes.
2002-10-17 Versison 1.10
Functionality extensions. Improved docs.
2002-06-10 Version 1.08
Bug fixes.
2001-12-31 Version 1.07
Added Borland C++ Builder support. Some bug fixes.
2001-11-29 Version 1.06
Better MSVC 6.0 compatibility.
Added ACCU article on dbg
2001-08-07 Version 1.05
Added compile time assertions
2001-06-24 Version 1.00
First public release of dbg

More dbg
Documentation Online docs (generated by kdoc)
ACCU article An Overload article on dbg published by the ACCU.
View the code online
dbg.hLibrary header file
dbg.cppLibrary implementation
test.cppTest harness
Examples Example code from the dbg documentation
Download Get the code (along with a Unix makefile and test harness)

By the same author
TSE3sequencer engine library
AnthemKDE MIDI sequencer
See also ACCU - the international organisation for professionalism in programming


Author Pete Goodliffe
Last updated 2003-07-20