Skip to main content
Glama

lldb_help

Get help on LLDB debugging commands and usage, including syntax, options, and specific topics like breakpoints or memory inspection.

Instructions

Get help on LLDB commands and usage.

Provides:
- General LLDB usage (empty topic)
- Help on specific commands (e.g., 'breakpoint', 'memory')
- Command syntax and options

Args:
    topic: Command or topic to get help on (empty for general help)

Returns:
    str: Help text for the specified topic

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNo

Implementation Reference

  • The main handler function for the 'lldb_help' tool. It constructs an LLDB 'help' command with an optional topic, executes it using the helper, and formats the output as markdown.
    async def lldb_help(topic: str = "") -> str:
        """Get help on LLDB commands and usage.
    
        Provides:
        - General LLDB usage (empty topic)
        - Help on specific commands (e.g., 'breakpoint', 'memory')
        - Command syntax and options
    
        Args:
            topic: Command or topic to get help on (empty for general help)
    
        Returns:
            str: Help text for the specified topic
        """
        cmd = "help"
        if topic:
            cmd += f" {topic}"
    
        result = _run_lldb_command(cmd)
    
        return f"## LLDB Help{': ' + topic if topic else ''}\n\n```\n{result['output'].strip()}\n```"
  • Registers the 'lldb_help' tool with MCP, including metadata annotations indicating it's read-only, idempotent, etc.
    @mcp.tool(
        name="lldb_help",
        annotations={
            "title": "LLDB Help",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
  • Supporting helper function that runs arbitrary LLDB commands via subprocess and returns structured results (success, output, error). Called by the lldb_help handler.
    def _run_lldb_command(
        command: str,
        target: str | None = None,
        args: list[str] | None = None,
        working_dir: str | None = None,
        timeout: int = 30,
    ) -> dict[str, Any]:
        """
        Execute an LLDB command and return the output.
    
        This runs LLDB in batch mode for simple commands.
        """
        cmd = [LLDB_EXECUTABLE]
    
        if target:
            cmd.extend(["--file", target])
    
        # Add batch commands
        cmd.extend(["--batch", "-o", command])
    
        if args:
            cmd.append("--")
            cmd.extend(args)
    
        try:
            result = subprocess.run(
                cmd, capture_output=True, text=True, timeout=timeout, cwd=working_dir or os.getcwd()
            )
            return {
                "success": result.returncode == 0,
                "output": result.stdout,
                "error": result.stderr if result.returncode != 0 else None,
                "return_code": result.returncode,
            }
        except subprocess.TimeoutExpired:
            return {
                "success": False,
                "output": "",
                "error": f"Command timed out after {timeout} seconds",
                "return_code": -1,
            }
        except FileNotFoundError:
            return {
                "success": False,
                "output": "",
                "error": f"LLDB executable not found at '{LLDB_EXECUTABLE}'. Please ensure LLDB is installed and in PATH.",
                "return_code": -1,
            }
        except Exception as e:
            return {"success": False, "output": "", "error": str(e), "return_code": -1}

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/benpm/claude_lldb_mcp'

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