| 180 | } |
| 181 | |
| 182 | pub(crate) fn configure_coverage(config: &FuzzConfig, vm: &mut Vm) -> Box<dyn CoverageAny> { |
| 183 | tracing::info!("Using: {:?} for coverage", config.coverage_mode); |
| 184 | match config.coverage_mode { |
| 185 | icicle_fuzzing::CoverageMode::Blocks => { |
| 186 | Box::new(BlockCoverage::init(vm, BucketStrategy::Any, true)) |
| 187 | } |
| 188 | icicle_fuzzing::CoverageMode::BlockCounts => { |
| 189 | Box::new(BlockCoverage::init(vm, BucketStrategy::AflFirst, false)) |
| 190 | } |
| 191 | icicle_fuzzing::CoverageMode::EdgeCounts => Box::new(EdgeCountMap::hit_counts(vm, config)), |
| 192 | icicle_fuzzing::CoverageMode::Edges => { |
| 193 | Box::new(EdgeCountMap::with_strategy(vm, config, BucketStrategy::Any)) |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | pub(crate) struct WorkdirLock { |
| 199 | file: Option<std::fs::File>, |