╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ dump-cov.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
77 78 const source_locations = try arena.alloc(std.debug.Coverage.SourceLocation, sorted_pcs.len); 79 try debug_info.resolveAddresses(gpa, io, sorted_pcs, source_locations); 80 81 const seen_pcs = header.seenBits(); 82 83 for (sorted_pcs, source_locations) |pc, sl| { 84 if (sl.file == .invalid) { 85 try stdout.print(" {x}: invalid\n", .{pc}); 86 continue; 87 } 88 const file = debug_info.coverage.fileAt(sl.file); 89 const dir_name = debug_info.coverage.directories.keys()[file.directory_index]; 90 const dir_name_slice = debug_info.coverage.stringAt(dir_name); 91 const seen_i = indexed_pcs.getIndex(pc).?; 92 const hit: u1 = @truncate(seen_pcs[seen_i / @bitSizeOf(usize)] >> @intCast(seen_i % @bitSizeOf(usize))); 93 try stdout.print("{c}{x}: {s}/{s}:{d}:{d}\n", .{ 94 "-+"[hit], pc, dir_name_slice, debug_info.coverage.stringAt(file.basename), sl.line, sl.column, 95 }); 96 } 97 98 try stdout.flush(); 99 } 100