Expand description
§drcov
A high-quality, idiomatic, and self-contained Rust library for parsing and writing DrCov coverage files.
This library provides a complete implementation for reading and writing DrCov coverage files, supporting format version 2 with module table versions 2-4 and legacy module tables.
§References
- DrCov format analysis: https://www.ayrx.me/drcov-file-format/
- DynamoRIO drcov tool: https://dynamorio.org/
- Lighthouse plugin: https://github.com/gaasedelen/lighthouse
§Example Usage
use drcov::{CoverageData, ModuleTableVersion};
// Reading a file
let coverage = drcov::from_file("coverage.drcov").unwrap();
// Creating coverage data using the builder
let new_coverage = CoverageData::builder()
.flavor("my_tool")
.module_version(ModuleTableVersion::V4)
.add_module("/bin/program", 0x400000, 0x450000)
.add_module("/lib/libc.so", 0x7fff00000000, 0x7fff00100000)
.add_coverage(0, 0x1000, 32) // module 0, offset 0x1000, size 32
.build()
.unwrap();
// Writing to a file
drcov::to_file(&new_coverage, "output.drcov").unwrap();Structs§
- Basic
Block - Represents an executed basic block.
- Coverage
Builder - A builder for creating
CoverageDatainstances. - Coverage
Data - Complete drcov coverage data structure.
- File
Header - DrCov file header containing version and tool information.
- Module
Entry - Represents a loaded module/library in the traced process.
Enums§
- Error
- Represents errors that can occur during drcov file processing.
- Module
Table Version - Module table format versions.
Functions§
- from_
file - Parses a drcov file from a file path.
- from_
reader - Parses a drcov file from any reader.
- to_file
- Writes coverage data to a file path.
- to_
writer - Writes coverage data to any writer.
Type Aliases§
- Result
- A specialized
Resulttype for drcov operations.