find_indirect_call_sites
Locate indirect call sites where C/C++ function pointer fields or variables are invoked, resolving calls that text search cannot detect.
Instructions
Find indirect call sites where a C/C++ function pointer field or
variable is invoked. libclang-powered: resolves calls through
function pointers (e.g. driver.onData(buf, len)), which
text-based search cannot detect.
Returns locations where a function pointer is called through a field
access (driver.onData(buf, len)) or variable dereference
(stored_callback(42)).
Read-only. No side effects. Use this to answer "where is this function
pointer invoked?" as opposed to find_callers which answers "who
calls this function?" and find_references which answers "where is
this symbol read or assigned?"
For the reverse query — which functions are assigned to a given field
or parameter — use find_indirect_targets.
Requires the reference index (fw-context index — refs on by default).
Args:
name: Name of the function pointer field or variable.
E.g. "onData" finds every call through a field named
onData. Uses three-tier resolution: exact name, exact
qualified, suffix LIKE.
project_root: Project root directory. Auto-detected if omitted.
limit: Maximum results (default 50, max 200).
Returns:
list of dicts, each with: file, line, expr_text (the callee
expression, e.g. "driver.onData"), target_usr, target_name,
fn_ptr_type (the function pointer type signature), caller
(enclosing function name), caller_kind.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the function pointer field or variable to find call sites of. E.g. 'onData' finds all calls through Driver::onData. | |
| limit | No | Maximum results (default 50). | |
| project_root | No | Project root directory. Auto-detected if omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |