find_indirect_targets
Find functions assigned to a C/C++ function pointer field and the call sites that invoke them, linking assignments to calls using symbol references instead of text search.
Instructions
Find functions assigned to a C/C++ function pointer field or variable. libclang-powered: links assignment sites to call sites via the field's unique symbol reference, which text-based search cannot resolve.
Links assignment sites (driver.onData = &handler) to call
sites (driver.onData(buf, len)) via the field's USR.
Returns each function that could be invoked through the named function
pointer, showing both the assignment location and the call site(s).
When a function is assigned but no call site is found, call_file
and call_line are null — the assignment exists but the
invocation may be in unindexed code.
For the reverse query — where is this field or parameter called — use
find_indirect_call_sites.
Read-only. No side effects. Requires the reference index
(fw-context index — refs on by default).
Args:
name: Name of the function pointer field, variable, or parameter.
E.g. "onData" finds every function assigned to a field
named onData. Uses three-tier resolution.
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: rhs_name (assigned function), rhs_qname, fn_ptr_type, method (assignment/call_arg/var_init/ init_list), assign_file, assign_line, assign_caller, call_file, call_line, call_expr_text.
An entry can carry ``_note`` (str) when fw-context cannot resolve
the direct call site — the callee is template-obscured, or the call
site comes from the type-based fallback. Read that note before you
act on ``call_file`` and ``call_line``.
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, variable, or parameter. E.g. 'onData' — returns functions assigned to 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, max 200). | |
| 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. 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 |