Skip to main content
Glama

debugger_start

Start a debugging session with auto-detection or specified debugger type to control program execution, examine memory, and analyze stack in GDB.

Instructions

Start a debugging session with auto-detection or specified debugger type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
debugger_type_paramNo
debugger_pathNo

Implementation Reference

  • server.py:42-56 (handler)
    Main MCP tool handler for debugger_start. Registered with @mcp.tool() decorator, validates debugger availability, sets default path, and delegates to debugger_tools.start_session()
    @mcp.tool()
    def debugger_status() -> str:
        """Get status of available debuggers."""
        return DebuggerFactory.list_debuggers()
    
    @mcp.tool()
    def debugger_start(debugger_type_param: str = None, debugger_path: str = None) -> str:
        """Start a debugging session with auto-detection or specified debugger type."""
        if not debugger_tools:
            return "Error: No debuggers are available on this system"
        
        if debugger_path is None:
            debugger_path = "gdb"  # Default to gdb
        
        return debugger_tools.start_session(debugger_path)
  • GDB-specific implementation of start_session. Creates a GDB session via the session manager and returns session ID
    @handle_gdb_errors("starting GDB session")
    def start_session(self, gdb_path: str = "gdb") -> str:
        session_id = self.sessionManager.create_session(gdb_path)
        return f"GDB session started successfully. Session ID: {session_id}"
  • LLDB-specific implementation of start_session. Creates an LLDB session via the session manager and returns session ID
    @handle_lldb_errors("starting LLDB session")
    def start_session(self, debugger_path: Optional[str] = None) -> str:
        session_id = self.session_manager.create_session(debugger_path)
        return f"LLDB session started successfully. Session ID: {session_id}"
  • Abstract interface definition for start_session method that all debugger implementations must provide
    @abstractmethod
    def start_session(self, debugger_path: str = None) -> str:
        """Start a new debugging session."""
        pass
  • Low-level GDB session creation using GdbController with MI3 interpreter, generates UUID session ID
    def create_session(self, gdb_path: str = "gdb") -> str:
        session_id = str(uuid.uuid4())
        try:
            gdb_controller = GdbController(command=[gdb_path, "--interpreter=mi3"])
            self.sessions[session_id] = gdb_controller
            logger.info(f"Started GDB session: {session_id}")
            return session_id
        except Exception as e:
            logger.error(f"Failed to start GDB session: {e}")
            raise

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