Resolves anchor IDs to source lines using line_info facts.
Layer 1 stamps every instruction with the source line in effect
(schema version 3), so an instruction ID resolves to its exact line
and a function ID to its first stamped line. Build a table once per
extraction with from_facts/1 or from_facts_dir/1, then resolve/2
the ID forms findings carry: witness-column strings, Argus.InstrId
structs, or MFA tuples.
Resolution is best-effort by design: IDs from modules without a
parseable Line chunk, compiler-generated code under a no-location
marker, and strings that are not IDs at all resolve to nil, never a
guess.
Summary
Functions
Builds line tables from an extracted facts map (raw string rows, as
returned by Argus.Pipeline.extract/2 with the default format).
Builds line tables from a .facts directory (the line_info.facts
file written by Argus.Pipeline.run/3). A missing or unreadable file
yields empty tables — every lookup resolves to nil.
Resolves an anchor to its source line, or nil.
Types
@type t() :: %{ by_instr: %{required(String.t()) => pos_integer()}, by_func: %{required(String.t()) => pos_integer()} }
Line tables: exact per-instruction plus first-line per function.
Functions
Builds line tables from an extracted facts map (raw string rows, as
returned by Argus.Pipeline.extract/2 with the default format).
Builds line tables from a .facts directory (the line_info.facts
file written by Argus.Pipeline.run/3). A missing or unreadable file
yields empty tables — every lookup resolves to nil.
@spec resolve(t(), String.t() | Argus.InstrId.t() | mfa()) :: pos_integer() | nil
Resolves an anchor to its source line, or nil.
Accepts an instruction ID string ("Mod:func/arity#idx" — exact
line), a function ID string ("Mod:func/arity" — the function's
first line), an Argus.InstrId, or an MFA tuple. Any other string
(module names, extractor placeholders like "dynamic") misses both
tables and resolves to nil.