find_indirect_call_sites
Find C/C++ function pointer call sites that text search misses. Resolves invocations through fields or variables like driver.onData(buf,len) to answer where a callback is actually called.
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.
project: Project name or project_id — call list_projects to get them. Use
it to ask about a project that is not the project of the current
directory. It is an alternative to project_root, which takes a root
path. Give one of the two, not both.
limit: Maximum results (default 50, max 200).
variant: Build variant (multi-build project). Omit to use
default_variant. One query answers for ONE build.
image: Sysbuild image within the variant. Required when the
variant holds several: each image is a separate program.
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.
Never empty: one dict with ``error`` (cannot resolve) or ``info``
(no results) replaces the results. Check both keys first.
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. | |
| image | No | Sysbuild image within the variant. Required when the variant holds several: each image is a separate program. | |
| limit | No | Maximum results (default 50). | |
| project | No | Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both. | |
| variant | No | Build variant (multi-build project). Omit to use default_variant. One query answers for ONE build. | |
| project_root | No | Project root directory. Auto-detected if omitted. This field also accepts a project name or a project_id, but project is the clear field for those. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |