Skip to main content
Glama

lldb_examine_variables

Inspect local variables and function arguments at a breakpoint in C/C++ programs. Use this debugging tool to analyze program state during execution by specifying an executable and breakpoint location.

Instructions

Examine local variables and arguments at a breakpoint.

Runs the program until the specified breakpoint, then displays the values of local variables and function arguments. Args: params: ExamineVariablesInput with executable, breakpoint, and optional variable names Returns: str: Variable values at the breakpoint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • Handler function that executes the lldb_examine_variables tool: sets breakpoint, runs program, examines frame variables using LLDB batch commands, formats output as markdown or JSON.
    async def lldb_examine_variables(params: ExamineVariablesInput) -> str: """Examine local variables and arguments at a breakpoint. Runs the program until the specified breakpoint, then displays the values of local variables and function arguments. Args: params: ExamineVariablesInput with executable, breakpoint, and optional variable names Returns: str: Variable values at the breakpoint """ commands = [ f"target create {params.executable}", f"breakpoint set --name {params.breakpoint}", "run" + (" " + " ".join(params.args) if params.args else ""), ] if params.variables: for var in params.variables: commands.append(f"frame variable {var}") else: commands.append("frame variable") commands.append("quit") result = _run_lldb_script(commands) if params.response_format == ResponseFormat.JSON: return json.dumps( { "success": result["success"], "breakpoint": params.breakpoint, "output": result["output"], "error": result.get("error"), }, indent=2, ) lines = [ f"## Variables at `{params.breakpoint}`", "", "```", result["output"].strip() if result["success"] else result.get("error", "Unknown error"), "```", ] return "\n".join(lines)
  • Pydantic input schema defining parameters for the lldb_examine_variables tool: executable path, breakpoint location, optional variables list, program args, and output format.
    class ExamineVariablesInput(BaseModel): """Input for examining variables.""" model_config = ConfigDict(str_strip_whitespace=True) executable: str = Field(..., description="Path to the executable", min_length=1) breakpoint: str = Field(..., description="Breakpoint location to stop at", min_length=1) variables: list[str] | None = Field( default=None, description="Specific variable names to examine (if None, shows all locals)" ) args: list[str] | None = Field( default=None, description="Command-line arguments to pass to the program" ) response_format: ResponseFormat = Field( default=ResponseFormat.MARKDOWN, description="Output format" )
  • MCP tool decorator registering the lldb_examine_variables handler function with name, title, and operational hints (read-only, idempotent).
    @mcp.tool( name="lldb_examine_variables", annotations={ "title": "Examine Variables", "readOnlyHint": True, "destructiveHint": False, "idempotentHint": True, "openWorldHint": False, }, )

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