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
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No |
Implementation Reference
- lldb_mcp_server.py:1252-1272 (handler)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```"
- lldb_mcp_server.py:1242-1251 (registration)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, }, )
- lldb_mcp_server.py:66-116 (helper)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}