$ show fabioz/PyDev.Debugger
The PyDev.Debugger (pydevd) is a Python debugger backend designed for IDE integration and remote debugging. It provides core debugging capabilities including breakpoints, stepping, variable inspection, and expression evaluation. The architecture features a client/server model for remote debugging, with in-process tracing via settrace(). Key entry points include pydevd.py (main debugger), pydevd_attach_to_process (live process attachment), and pydevconsole.py (interactive console). The debugger supports multiple protocols (legacy line-based and JSON/DAP for VS Code integration) and employs Cython optimizations with fallbacks to pure Python. It includes extensive test suites covering edge cases like multiprocessing, async, GUI event loops, and framework-specific integrations (Django, Flask). The code demonstrates strong modularity through extension points for custom variable rendering and plugin architecture.
The LLM identified 5 files worth highlighting for reuse:
Defines extension points (TypeResolveProvider, StrPresentationProvider, DebuggerEventHandler) for custom variable rendering and debugger events. Enables plugins like Django forms or NumPy array visualization without modifying core code, demonstrating clean plugin architecture.
Implements robust socket communication with timeout handling and packetization. Supports both XML and JSON/DAP protocols via factory patterns, providing a reusable networking layer for debugger-IDE communication that handles protocol abstraction and error recovery.
Vendored bytecode library for instruction analysis, control flow graph construction, and peephole optimization. Used for frame evaluation and smart step-into functionality, demonstrating advanced bytecode manipulation skills in a self-contained module.
Manages thread states (suspended/resumed) during debugging using thread-local storage. Provides clean interface for tracking debugger-specific thread information with minimal coupling, showcasing effective thread lifecycle management patterns.
Handles path translation between IDE and target environments, including symlink resolution and case sensitivity. Essential for remote debugging scenarios, demonstrating robust cross-platform path handling with reusable utility functions.