Overview
First implemented in 1997, after reading the amazing book from Steve Maguire,
"L'art du code" (French translated title), by Microsoft Press.
Non intrusive, provides enhanced assertions, checkpoints and a transparent
memoryleak tracker.
Way faster than valgind, it can be compiled and used by end-users to provide a
useful debug log without significant impact on resources and performances. It is
probably incompatible with Valgrind. Probably in competition with gcc's
-fsanitize=address, probably incompatible with it.
Assertions and traces¶
assert.h - Macro and functions definitions.
libdebug.a/so - assertion output functions implementations
When enabled (NDEBUG is undefined) , the macros call the output functions
defined in assert.h and implemented in libdebug, with contextual metadata
(filename, line number, compilation date and time, and function name). func
gcc extension is used. libdebug.a/so needs to be linked to the binaries.
When disabled (NDEBUG defined), the functions are not defined and the macros are
mapped to no operation. libdebug.a/so does not need to be linked to the binaries.
Memory tracking and leaks detection¶
memory.h - Macro definition to include last
memdbg.h - automatically included from include path
memtrack.h - automatically included from include path
libdebug.a/so - memory tracking functions implementations
When enabled (NDEBUG undefined), this file needs to be included as the last
include line in the source code, in order to be applied only on the source code,
not on the other includes. It replaces memory allocation/free standard functions
with a call to an internal wrapper defined in memdbg.h/c and libdebug.a/so. It
includes memdbg.h and transitively memtrack.h. libdebug.a/so needs to be linked
to the binaries.
When disabled (NDEBUG defined), the replacement macros are not defined, thus the
memory allocation and free standard functions are directly called without
involving the wrappers. memdbg.h and memtrack.h are not included. The
memreport() calls are replaced by no operation thanks to an empty macro.
libdebug.a/so does not need to be linked with the binaries.
Members
Manager : François Cerbelle