gdbmongo
GDB pretty printers and commands for debugging the MongoDB Server
What it is and what it does
Gdbmongo is a GDB extension that adds pretty printers and debugging commands specifically for MongoDB Server internals. It is designed primarily for MongoDB employees and contributors who need to inspect server state during development and troubleshooting. The package walks in-memory data structures rather than executing C++ code, which allows it to work against both live processes and saved core dumps—a critical capability for post-mortem analysis in CI/CD environments.
The package targets a moving target: instead of fragmenting tools across each MongoDB version branch, gdbmongo aims to be a single version that works across multiple supported MongoDB releases. It currently supports dumping the global LockManager, displaying thread names, inspecting CursorManager partitions, and decoding BSON objects. Installation requires manual setup in GDB's Python environment (not a virtual environment), and pretty printer collections can be selectively enabled or disabled within GDB.
Use it for:
- Analyze MongoDB server core dumps in CI/CD pipelines to diagnose hangs, crashes, or resource contention without rebuilding the server.
- Inspect the global LockManager state in a running MongoDB process to understand lock holders and waiters during development.
- Decode BSON objects and thread metadata in core dumps to reconstruct server state at the time of failure.
- Debug MongoDB 4.2 through 8.1 binaries with a single tool version instead of maintaining branch-specific GDB extensions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Gdbmongo provides GDB pretty printers and commands for inspecting MongoDB Server internals in live processes and core dumps, with support for multiple MongoDB versions.
Yes, if you are debugging MongoDB Server internals or analyzing MongoDB core dumps. The package is low-friction to install, has no runtime dependencies, and is actively maintained for recent MongoDB versions. No, if you are not working on MongoDB Server itself or do not have access to GDB with Python support in your environment.
Install
gdbmongo on PyPI
pip
pip install gdbmongouv
uv add gdbmongopoetry
poetry add gdbmongoInstalling gdbmongo
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant but recent—last commit 2025-02-13—and the package is actively tested against current MongoDB versions. Installation requires manual setup in GDB's Python environment, not a standard virtual environment.
License in practice
Apache License 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and private projects provided you include the license notice.
Quickstart
# Add to ~/.gdbinit:
python
import gdbmongo
gdbmongo.register_printers()
end
# In GDB:
(gdb) python lock_mgr = gdbmongo.LockManagerPrinter.from_global()
(gdb) python print(lock_mgr.val)
GDB must be linked against the same Python installation where gdbmongo is installed; virtual environments do not work because GDB uses the base system libpython.
Verify before relying
- Whether the package works reliably against all advertised MongoDB versions or only those explicitly tested in recent releases.
- Performance impact of pretty printer registration on GDB startup time or responsiveness.
- Whether core dump analysis works across different architectures or only within the MongoDB toolchain environment.
Package facts
| License | Apache License, Version 2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 547 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,736,963/month — #3,605 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gdbmongo-0.16.0-py3-none-any.whl
Keywords: mongo, mongodb, gdb
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
freertos-gdbA GDB Python plugin that adds commands to…
permissive · top 5,000 on PyPI
prettyprinterSyntax-highlighted, declarative pretty printer…
permissive · top 5,000 on PyPI
pygdbmiParses GDB machine interface output into…
permissive · top 5,000 on PyPI
apache-airflow-providers-mongoIntegrates MongoDB with Apache Airflow as a…
permissive · top 5,000 on PyPI
pymongoPyMongo is the official MongoDB Python driver,…
permissive · top 1,000 on PyPI
curatorbinPackages the MongoDB Curator tool as a Python…
unclear · top 5,000 on PyPI
pymongo_inmemoryProvides an in-memory MongoDB instance for…
permissive · top 15,000 on PyPI
pydantic-mongoProvides a Repository pattern for MongoDB with…
permissive · top 15,000 on PyPI
Flask-PyMongoFlask-PyMongo integrates MongoDB database…
permissive · top 15,000 on PyPI
wadler-lindigFormats Python objects for readable output…
permissive · top 5,000 on PyPI