Skip to main content

generate_lcov

Function generate_lcov 

Source
pub fn generate_lcov(
    trace_dir: &Path,
    programs: &BTreeMap<String, PathBuf>,
    manifest_dir: Option<&Path>,
    output: &Path,
) -> Result<()>
Expand description

Generate an LCOV file from register trace data.

trace_dir — directory containing .regs files (litesvm SBF_TRACE_DIR). programs — map of program_id (base58) → deployed .so path (from discover_programs). The unstripped version is resolved automatically via [find_unstripped_binary]. manifest_dir — workspace manifest dir; used to (1) locate unstripped binaries and (2) resolve relative source paths emitted by DWARF (Solana’s cargo passes -Zremap-cwd-prefix= which strips DW_AT_comp_dir, so paths come back as lang-v2/src/cpi.rs rather than absolute). output — path to write the LCOV file.

Emitted entries are filtered to files that actually exist on disk. This drops phantom paths from dependency crates (e.g. pinocchio’s bare src/de/mod.rs) that can’t be resolved without per-crate context.