debug(3)

πŸ’– debug(3) β€” Debug Macros πŸ’–

okay bestie, welcome to the debug page β€” it's a Library Functions Manual situation, and it's literally all about the debug macros, no cap. it's giving "tiny page, big attitude," and honestly? we're obsessed. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

✨ Macros ✨

#define MDB_DEBUG   0
#define MDB_DBG_INFO   1
#define MDB_DBG_TRACE   2
#define DPRINTF(args)
#define MDB_TRACE(args)
#define DPUTS(arg)
#define DDBI(mc)

🌸 Detailed Description 🌸

so like… there is a section called Detailed Description, and bestie, it's serving absolutely nothing β€” no body text, just a heading living its truth. iconic behavior honestly. πŸ’… everything juicy lives down in the macro docs, so let's go. 🫢


πŸ‘‘ Macro Definition Documentation πŸ‘‘

🌈 #define MDB_DEBUG 0

this is THE switch, the main character. it enables debug output. ⭐

  • it needs variable argument macros (that's a C99 feature, iykyk β€” so like, make sure your compiler is not doing the most ancient thing).
  • set it to 1 for copious tracing (copious!! the tracing is unhinged and we love that).
  • set it to 2 to add dumps of all the IDLs read from and written to the database β€” and yes, that includes the ones used for free space management.
fr fr, pick your number on purpose. 1 is chatty, 2 is chatty and dumping every IDL in sight. πŸ’€

🌼 #define DPRINTF(args)

Value:

((void) 0)

ngl, that's the whole thing. that's the value. it's a no-op and it's not even sorry about it. πŸ“


🧚 #define MDB_TRACE(args)

Value:

((void) 0)

same energy as its bestie above: does absolutely nothing, slays while doing it. ✨


πŸŽ€ #define DPUTS(arg)

Value:

DPRINTF(("%s", arg))

okay so what this does: it prints a debug string. and here's the important part β€” the string gets printed literally, with no format processing at all. so like, no sneaky % surprises, it just says what it says. πŸ’œ


πŸ¦„ #define DDBI(mc)

Value:

(((mc)->mc_flags & C_SUB) ? -(int)(mc)->mc_dbi : (int)(mc)->mc_dbi)

this one is the debugging output value of a cursor DBI, and here's the lil plot twist: it comes out negative in a sub-cursor. so if you're staring at a negative number and spiraling, that's not a bug, bestie, that's the sub-cursor flag doing its thing. 😭πŸ”₯


πŸ’« Author πŸ’«

Generated automatically by Doxygen for LMDB from the source code. (so like, nobody hand-wrote this, the robots did it, and they ate. πŸ€–βœ¨)


<div align="center">πŸŒΈπŸ’–πŸ¦‹βœ¨πŸŽ€</div>

and that's the whole page, bestie β€” brought to you by the fine folks at LMDB, filed under debug(3) in the good ol' Library Functions Manual. mwah, ily, go drink some water and check your MDB_DEBUG value. πŸ’…πŸ«ΆπŸ’–

πŸ“¦ where this page comes from