### Berkeley DB Reference Guide: Debugging |

# Compile-time configuration

There are two compile-time configuration options that assist in debugging Berkeley DB and Berkeley DB applications.

--enable-debug
  If you want to build Berkeley DB with -g as the C and C++ compiler flag and with DEBUG #defined during compilation, enter --enable-debug as an argument to configure. This will create Berkeley DB with debugging symbols, as well as load various routines that can be called from a debugger to display pages, cursor queues and so forth.

--enable-diagnostic
  If you want to build Berkeley DB with debugging run-time sanity checks and with DIAGNOSTIC #defined during compilation, enter --enable-diagnostic as an argument to configure. This will cause a number of special checks to be performed when Berkeley DB is running. This flag should not be defined when configuring to build production binaries, as it degrades performance.

  In addition, when compiling Berkeley DB for use in run-time memory consistency checkers, in particular, programs that look for reads and writes of uninitialized memory, use --enable-diagnostic as an argument to configure. This guarantees that Berkeley DB will completely initialize allocated pages rather than only initializing the minimum necessary amount.

Copyright Sleepycat Software