Skip to main content
Glama

lldb_symbols

Look up symbols like functions, variables, and types in executables using exact names, regex patterns, addresses, or type definitions 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

  • The main handler function for the lldb_symbols tool, which performs symbol lookup using LLDB's image lookup command based on the input parameters.
    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```"
  • Pydantic model defining the input schema for the lldb_symbols tool, including 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)", )
  • The @mcp.tool decorator that registers the lldb_symbols function as an MCP tool with the name 'lldb_symbols' and appropriate annotations.
    @mcp.tool( name="lldb_symbols", annotations={ "title": "Lookup Symbols", "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