Skip to content

Commit 925dea0

Browse files
committed
Add HTML coverage viewer and LCOV output format
1 parent efaf642 commit 925dea0

File tree

28 files changed

+1692
-159
lines changed

28 files changed

+1692
-159
lines changed

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ intervaltree = "0.2.7"
9797
lending-iterator = "0.1.7"
9898
rustc-demangle = "0.1.24"
9999
cpp_demangle = "0.4.3"
100+
walkdir = "2.5.0"
101+
md5 = "0.7.0"
102+
sha1 = "0.10.6"
103+
sha2 = "0.10.8"
104+
typed-path = "0.9.0"
105+
markup = "0.15.0"
106+
petgraph = "0.6.5"
100107

101108
[dev-dependencies]
102109
simics-test = "0.1.0"

src/haps/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ impl Tsffs {
6262
self.windows_os_info.collect(
6363
start_processor_raw,
6464
&self.debuginfo_download_directory,
65-
self.guess_pdb_function_size,
6665
DebugInfoConfig {
6766
system: self.symbolic_coverage_system,
6867
user_debug_info: &self.debug_info,
6968
},
69+
&self.source_file_cache,
7070
)?;
7171
}
7272
self.get_and_write_testcase()?;
@@ -225,11 +225,11 @@ impl Tsffs {
225225
self.windows_os_info.collect(
226226
processor,
227227
&self.debuginfo_download_directory,
228-
self.guess_pdb_function_size,
229228
DebugInfoConfig {
230229
system: self.symbolic_coverage_system,
231230
user_debug_info: &self.debug_info,
232231
},
232+
&self.source_file_cache,
233233
)?;
234234
}
235235

@@ -271,11 +271,11 @@ impl Tsffs {
271271
self.windows_os_info.collect(
272272
processor,
273273
&self.debuginfo_download_directory,
274-
self.guess_pdb_function_size,
275274
DebugInfoConfig {
276275
system: self.symbolic_coverage_system,
277276
user_debug_info: &self.debug_info,
278277
},
278+
&self.source_file_cache,
279279
)?;
280280
}
281281

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ use simics::{
6363
// which is necessary because this module is compatible with base versions which cross the
6464
// deprecation boundary
6565
use simics::{restore_snapshot, save_snapshot};
66+
use source_cov::{Coverage, SourceCache};
6667
use state::StopReason;
6768
use std::{
6869
alloc::{alloc_zeroed, Layout},
@@ -91,6 +92,7 @@ pub(crate) mod interfaces;
9192
pub(crate) mod log;
9293
pub(crate) mod magic;
9394
pub(crate) mod os;
95+
pub(crate) mod source_cov;
9496
pub(crate) mod state;
9597
pub(crate) mod tracer;
9698
pub(crate) mod traits;
@@ -407,9 +409,6 @@ pub(crate) struct Tsffs {
407409
#[class(attribute(optional, default = lookup_file("%simics%")?.join("debuginfo-cache")))]
408410
/// Directory in which to download PDB and EXE files from symbol servers on Windows
409411
pub debuginfo_download_directory: PathBuf,
410-
#[class(attribute(optional, default = true))]
411-
/// Whether to guess the size of each function provided by a PDB file
412-
pub guess_pdb_function_size: bool,
413412
#[class(attribute(optional))]
414413
/// Mapping of file name (name and extension e.g. fuzzer-app.exe or target.sys)
415414
/// to a tuple of (exe path, debuginfo path) where debuginfo is either a PDB or DWARF
@@ -477,6 +476,9 @@ pub(crate) struct Tsffs {
477476
edges_seen_since_last: HashMap<u64, u64>,
478477
/// The set of PCs comprising the current execution trace. This is cleared every execution.
479478
execution_trace: ExecutionTrace,
479+
/// The current line coverage state comprising the total execution. This is not
480+
/// cleared and is persistent across the full campaign until the fuzzer stops.
481+
coverage: Coverage,
480482

481483
/// The name of the fuzz snapshot, if saved
482484
snapshot_name: OnceCell<String>,
@@ -524,6 +526,7 @@ pub(crate) struct Tsffs {
524526

525527
windows_os_info: WindowsOsInfo,
526528
cr3_cache: HashMap<i32, i64>,
529+
source_file_cache: SourceCache,
527530
}
528531

529532
impl ClassObjectsFinalize for Tsffs {

0 commit comments

Comments
 (0)