graph LR
DebuggerEntryPoints["DebuggerEntryPoints"]
DebuggerInitialization["DebuggerInitialization"]
DebuggerClassResolver["DebuggerClassResolver"]
ConfigurationContextProcessor["ConfigurationContextProcessor"]
RawConfigurationLoader["RawConfigurationLoader"]
ConfigFileHandler["ConfigFileHandler"]
ExceptionHookWrapper["ExceptionHookWrapper"]
DebuggerEntryPoints -- "initiates" --> DebuggerInitialization
DebuggerEntryPoints -- "integrates with" --> ExceptionHookWrapper
DebuggerInitialization -- "configures with" --> DebuggerClassResolver
DebuggerInitialization -- "configures with" --> ConfigurationContextProcessor
ConfigurationContextProcessor -- "retrieves from" --> RawConfigurationLoader
RawConfigurationLoader -- "reads via" --> ConfigFileHandler
The ipdb subsystem is structured around a set of DebuggerEntryPoints that serve as the primary user interface for initiating debugging sessions. These entry points orchestrate the debugging process by delegating to the DebuggerInitialization component, which is responsible for instantiating and configuring the debugger. The DebuggerInitialization component dynamically selects the appropriate debugger class through the DebuggerClassResolver and applies user-defined settings managed by the ConfigurationContextProcessor. Configuration data is loaded by the RawConfigurationLoader, which interacts with the ConfigFileHandler for file-level operations. Furthermore, the ExceptionHookWrapper component ensures seamless post-mortem debugging by intercepting unhandled exceptions, providing a robust debugging experience.
The primary interface for users to initiate debugging sessions. This component includes all public functions (set_trace, post_mortem, main, pm, run, runcall, runeval, launch_ipdb_on_exception) that directly invoke or integrate ipdb into Python code, orchestrating the initial debugger setup.
Related Classes/Methods:
ipdb.__main__.set_trace:72-80ipdb.__main__.post_mortem:205-214ipdb.__main__.main:270-353ipdb.__main__.pm:217-218ipdb.__main__.run:221-222ipdb.__main__.runcall:225-226ipdb.__main__.runeval:229-230ipdb.__main__.launch_ipdb_on_exception:233-242
Responsible for instantiating and performing the initial configuration of the debugger object. It acts as a factory, ensuring the correct debugger class is used and set up based on the environment and user settings.
Related Classes/Methods:
Dynamically determines and returns the appropriate debugger class (e.g., IPython.terminal.debugger.TerminalPdb for IPython integration or pdb.Pdb for standard Python debugging). This component is crucial for ipdb's adaptability to different execution environments.
Related Classes/Methods:
Retrieves and processes configuration settings (such as prompt and history file path) that define the debugger's operational context. It translates raw configuration data into usable parameters for the debugger.
Related Classes/Methods:
Handles the direct loading of raw configuration data for ipdb, typically from a configuration file. It serves as the immediate interface to the configuration source.
Related Classes/Methods:
Encapsulates the logic for locating, reading, and parsing ipdb's configuration files. This component manages the low-level file operations and data extraction from configuration sources.
Related Classes/Methods:
Modifies the system's default exception handling mechanism (sys.excepthook) to intercept unhandled exceptions. This allows ipdb to automatically launch for post-mortem analysis, acting as a critical hook for debugging.
Related Classes/Methods: