MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / Coverage

Interface Coverage

hail-fuzz/src/coverage.rs:12–36  ·  view source on GitHub ↗

Keeps track of the global coverage seen across the input corpus.

Source from the content-addressed store, hash-verified

10
11/// Keeps track of the global coverage seen across the input corpus.
12pub trait Coverage {
13 /// Get a estimate of the global coverage.
14 fn count(&self) -> u64;
15
16 /// Return a reference to the bits in the coverage map.
17 fn get_bits<'a>(&self, vm: &'a mut Vm) -> &'a [u64];
18
19 /// Return the the index of any newly hit bits in the current coverage map.
20 fn new_bits(&mut self, vm: &mut Vm) -> Vec<u32>;
21
22 /// Merge the local coverage state with the global state, returning true if coverage increased.
23 fn merge(&mut self, vm: &mut Vm) -> bool;
24
25 fn serialize(&self, _vm: &mut Vm, _out: &mut String) {}
26
27 /// Called at the very start of execution. Note: typically `restore_local` is used for
28 /// resetting testcases between testcase executions.
29 fn reset(&mut self, vm: &mut Vm);
30
31 /// Create a snapshot of the (local) coverage state that can be later restored.
32 fn snapshot_local(&mut self, vm: &mut Vm) -> Box<dyn Any>;
33
34 /// Restore the (local) coverage state to a previously saved snapshot.
35 fn restore_local(&mut self, vm: &mut Vm, snapshot: &Box<dyn Any>);
36}
37
38pub trait CoverageAny: Coverage {
39 fn as_any(&self) -> &dyn std::any::Any;

Callers

nothing calls this directly

Implementers 1

coverage.rshail-fuzz/src/coverage.rs

Calls

no outgoing calls

Tested by

no test coverage detected