graph LR
wrap_sys_excepthook["wrap_sys_excepthook"]
launch_ipdb_on_exception["launch_ipdb_on_exception"]
post_mortem["post_mortem"]
_init_pdb["_init_pdb"]
wrap_sys_excepthook -- "implicitly triggers" --> launch_ipdb_on_exception
launch_ipdb_on_exception -- "explicitly calls" --> post_mortem
post_mortem -- "explicitly calls" --> _init_pdb
post_mortem -- "re-establishes" --> wrap_sys_excepthook
The System Exception Hook Manager subsystem is responsible for intercepting unhandled system-level exceptions and automatically launching the ipdb debugger for post-mortem analysis. Its boundaries are defined by the ipdb.__main__ module, specifically focusing on the functions that manage the sys.excepthook and initiate the debugging session. This forms a clear chain of command for handling exceptions and launching the debugger, embodying the Hook/Interceptor and Execution Flow Control patterns.
Implements the "Hook/Interceptor Pattern" by replacing the default sys.excepthook. Its primary responsibility is to ensure that all unhandled exceptions are redirected to ipdb's custom handler, acting as the initial interception point for system exceptions.
Related Classes/Methods:
Serves as the custom exception handler invoked by wrap_sys_excepthook. This component is the primary dispatcher for ipdb's exception handling, responsible for initiating the debugging process when an unhandled exception is intercepted. It embodies the "Execution Flow Control" pattern for debugger activation.
Related Classes/Methods:
Manages the core logic of the post-mortem debugging session. This component orchestrates the steps required to allow inspection of the program state after an exception has been raised and caught by the exception hook, providing the interactive debugging environment. It is central to the "Core Debugger Logic."
Related Classes/Methods:
Handles the initialization and configuration of the ipdb debugger instance. This includes setting up the debugger's environment, potentially loading user-defined settings, and preparing it for interactive use. It is a foundational part of the "Core Debugger Logic" within the subsystem.
Related Classes/Methods: