debugger_terminate
End a GDB debugging session by specifying its session ID to stop program execution and release debugging resources.
Instructions
Terminate a debugging session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
Implementation Reference
- server.py:58-63 (handler)MCP tool handler for debugger_terminate - the entry point that receives the tool invocation and delegates to the debugger tools implementation
@mcp.tool() def debugger_terminate(session_id: str) -> str: """Terminate a debugging session.""" if not debugger_tools: return "Error: No debuggers are available on this system" return debugger_tools.terminate_session(session_id) - modules/gdb/gdbTools.py:73-77 (handler)GDBTools.terminate_session - the tools-level implementation that wraps the session manager call with error handling and user-friendly messaging
@handle_gdb_errors("terminating session") def terminate_session(self, session_id: str) -> str: if self.sessionManager.terminate_session(session_id): return f"GDB session '{session_id}' terminated successfully" return f"GDB session '{session_id}' not found" - modules/gdb/sessionManager.py:39-50 (handler)GDBSessionManager.terminate_session - the core implementation that exits the GDB controller process and removes it from the active sessions dictionary
def terminate_session(self, session_id: str) -> bool: if session_id not in self.sessions: return False try: gdb = self.sessions[session_id] gdb.exit() del self.sessions[session_id] logger.info(f"Terminated GDB session: {session_id}") return True except Exception as e: logger.error(f"Failed to terminate GDB session: {e}") return False - modules/base/debuggerBase.py:47-50 (schema)Abstract interface definition for terminate_session in DebuggerTools base class - defines the contract all debugger implementations must follow
@abstractmethod def terminate_session(self, session_id: str) -> str: """Terminate a debugging session.""" pass - server.py:58-63 (registration)Tool registration via @mcp.tool() decorator - registers debugger_terminate as an MCP tool that can be invoked by AI assistants
@mcp.tool() def debugger_terminate(session_id: str) -> str: """Terminate a debugging session.""" if not debugger_tools: return "Error: No debuggers are available on this system" return debugger_tools.terminate_session(session_id)