Compile-time Configuration
There are three compile-time configuration options that assist with 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, enter —enable-debug as an argument to configure. This will create Berkeley DB with debugging symbols, as well as load various Berkeley DB routines that can be called directly from a debugger to display database page content, cursor queues, and so forth. (Note that the -O optimization flag will still be specified. To compile with only the -g, explicitly set the CFLAGS environment variable before configuring.)
—enable-diagnostic If you want to build Berkeley DB with debugging runtime sanity checks and with DIAGNOSTIC ...