Skip to main content
Glama

lldb_symbols

Look up symbols like functions, variables, and types in an executable using name, regex, address, or type searches to debug C/C++ programs.

Instructions

Look up symbols (functions, variables, types) in an executable.

Search types:
- 'name': Exact symbol name lookup
- 'regex': Regular expression pattern matching
- 'address': Find symbol at a specific address
- 'type': Look up a type definition

Args:
    params: SymbolLookupInput with query and search type

Returns:
    str: Symbol information including address and source location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • Main handler function that executes LLDB image lookup commands based on the query type to find symbols in the executable.
    async def lldb_symbols(params: SymbolLookupInput) -> str:
        """Look up symbols (functions, variables, types) in an executable.
    
        Search types:
        - 'name': Exact symbol name lookup
        - 'regex': Regular expression pattern matching
        - 'address': Find symbol at a specific address
        - 'type': Look up a type definition
    
        Args:
            params: SymbolLookupInput with query and search type
    
        Returns:
            str: Symbol information including address and source location
        """
        commands = [f"target create {params.executable}"]
    
        if params.query_type == "name":
            commands.append(f"image lookup --name {params.query}")
        elif params.query_type == "regex":
            commands.append(f"image lookup --regex --name {params.query}")
        elif params.query_type == "address":
            commands.append(f"image lookup --address {params.query}")
        elif params.query_type == "type":
            commands.append(f"image lookup --type {params.query}")
        else:
            commands.append(f"image lookup --name {params.query}")
    
        result = _run_lldb_script(commands)
    
        return f"## Symbol Lookup: `{params.query}`\n\n```\n{result['output'].strip()}\n```"
  • MCP tool registration decorator that registers the lldb_symbols handler with the FastMCP server.
    @mcp.tool(
        name="lldb_symbols",
        annotations={
            "title": "Lookup Symbols",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
  • Pydantic input schema defining parameters for the lldb_symbols tool: executable path, query string, and query type.
    class SymbolLookupInput(BaseModel):
        """Input for looking up symbols."""
    
        model_config = ConfigDict(str_strip_whitespace=True)
    
        executable: str = Field(..., description="Path to the executable", min_length=1)
        query: str = Field(..., description="Symbol name or pattern to search for", min_length=1)
        query_type: str = Field(
            default="name",
            description="Type of lookup: 'name' (exact), 'regex' (pattern), 'address' (hex address), 'type' (type name)",
        )

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