Skip to main content
Glama

debugger_status

Check available debuggers to monitor program execution and analyze binary states during debugging sessions.

Instructions

Get status of available debuggers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:42-45 (handler)
    The debugger_status() function is the MCP tool handler that returns status of available debuggers. It's registered with the @mcp.tool() decorator and calls DebuggerFactory.list_debuggers() to get the formatted output.
    @mcp.tool()
    def debugger_status() -> str:
        """Get status of available debuggers."""
        return DebuggerFactory.list_debuggers()
  • The list_debuggers() static method formats a human-readable list of available debuggers by calling get_available_debuggers() and creating a formatted string with status indicators (✓/✗) for each debugger type.
    def list_debuggers() -> str:
        """Get a formatted list of available debuggers."""
        available = DebuggerFactory.get_available_debuggers()
        
        lines = ["Available debuggers:"]
        for debugger_type, info in available.items():
            status = "✓ Available" if info['available'] else "✗ Not available"
            lines.append(f"  • {debugger_type.upper()}: {info['name']} - {status}")
            if info['description']:
                lines.append(f"    {info['description']}")
        
        return "\n".join(lines)
  • The get_available_debuggers() static method checks which debuggers (GDB and LLDB) are available on the system by calling their respective is_available() methods and returns a dictionary with availability status, names, and descriptions.
    @staticmethod
    def get_available_debuggers() -> dict:
        """Get information about available debuggers."""
        return {
            'gdb': {
                'available': GDBSessionManager.is_available(),
                'name': 'GNU Debugger (GDB)',
                'description': 'Traditional Unix debugger'
            },
            'lldb': {
                'available': LLDBSessionManager.is_available(),
                'name': 'LLVM Debugger (LLDB)', 
                'description': 'Modern LLVM-based debugger (macOS native)'
            }
        }
  • The is_available() static method for GDB checks if GDB is installed by running 'gdb --version' subprocess command and returns True if the command succeeds (returncode == 0).
    @staticmethod
    def is_available() -> bool:
        """Check if GDB is available on this system."""
        import subprocess
        try:
            result = subprocess.run(['gdb', '--version'], capture_output=True, timeout=5)
            return result.returncode == 0
        except (FileNotFoundError, subprocess.TimeoutExpired):
            return False
  • The is_available() static method for LLDB returns the LLDB_AVAILABLE global flag, which is set during module initialization when the LLDB Python module is successfully imported.
    @staticmethod
    def is_available() -> bool:
        """Check if LLDB is available on this system."""
        return LLDB_AVAILABLE

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