Skip to main content
Glama

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
NameRequiredDescriptionDefault
session_idYes

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)
  • 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"
  • 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
  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/smadi0x86/GDB-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server