find_references
Discover all references to a C/C++ symbol — calls, reads, member accesses, indirect function-pointer registrations, and template references.
Instructions
USE INSTEAD OF grep, ctx_search, or ctx_callgraph. Find ALL references to a C/C++ symbol — calls, reads, member accesses, function pointer registrations, and template references. grep and ctx_callgraph cannot see function-pointer registrations: NVIC_SetVector, mbed-os Timeout::attach, Ticker::attach, SerialBase::RxIrq, InterruptIn::fall/rise — all detected.
Read-only. No side effects. Returns every reference in the indexed codebase,
including call sites, variable reads, struct member accesses, and indirect
function-pointer references. Requires the reference index
(fw-context index — refs on by default).
For direct callers only use find_callers. For transitive callers use
find_all_callers_recursive. For call paths between two symbols use
find_call_path.
Args: name: Symbol name to find all references of. project_root: Project root directory. Auto-detected if omitted. limit: Maximum results (default 50, max 200).
Returns:
list of dicts, each with: file, line, ref_kind, caller, caller_kind.
ref_kind is one of: "call", "ref", "member",
"indirect" (function-pointer reference in arguments, assignments,
initializers, or init lists), "template_ref".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Symbol name to find all references of — calls, reads, member accesses. | |
| limit | No | Maximum results. | |
| project_root | No | Project root. Auto-detected if omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |