Skip to content

Commit f6603b6

Browse files
committed
Initial implementation, triaging some crashes
1 parent 23be831 commit f6603b6

File tree

13 files changed

+7352
-58
lines changed

13 files changed

+7352
-58
lines changed

Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ tracing-subscriber = "0.3.18"
7676
tracing = { version = "0.1.40", features = ["log"] }
7777
yaxpeax-arm = "0.3.0"
7878
chrono = "0.4.38"
79+
vergilius = "0.1.2"
80+
windows = { version = "0.57.0", features = [
81+
"Win32_Foundation",
82+
"Win32_System",
83+
"Win32_System_SystemServices",
84+
"Win32_System_Diagnostics_Debug",
85+
"Win32_System_Diagnostics",
86+
"Win32_System_SystemInformation",
87+
"Win32_System_Kernel",
88+
] }
89+
reqwest = { version = "0.12.5", features = ["blocking"] }
90+
pdb = "0.8.0"
91+
intervaltree = "0.2.7"
92+
lending-iterator = "0.1.7"
93+
rustc-demangle = "0.1.24"
94+
symbolic = { version = "12.9.2", features = ["demangle"] }
7995

8096
[dev-dependencies]
8197
simics-test = "0.1.0"

src/haps/mod.rs

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl Tsffs {
2929
let start_processor = self
3030
.start_processor()
3131
.ok_or_else(|| anyhow!("No start processor"))?;
32+
let start_processor_raw = start_processor.cpu();
3233

3334
let start_info = match magic_number {
3435
MagicNumber::StartBufferPtrSizePtr => {
@@ -54,6 +55,15 @@ impl Tsffs {
5455
.map_err(|_| anyhow!("Failed to set start time"))?;
5556
self.coverage_enabled = true;
5657
self.save_initial_snapshot()?;
58+
// Collect windows coverage info if enabled
59+
if self.windows && self.symbolic_coverage {
60+
self.windows_os_info.collect(
61+
start_processor_raw,
62+
&self.debuginfo_download_directory,
63+
self.guess_pdb_function_size,
64+
&self.debug_info,
65+
)?;
66+
}
5767
self.get_and_write_testcase()?;
5868
self.post_timeout_event()?;
5969
}
@@ -204,6 +214,16 @@ impl Tsffs {
204214
self.coverage_enabled = true;
205215
self.save_initial_snapshot()?;
206216

217+
// Collect windows coverage info if enabled
218+
if self.windows && self.symbolic_coverage {
219+
self.windows_os_info.collect(
220+
processor,
221+
&self.debuginfo_download_directory,
222+
self.guess_pdb_function_size,
223+
&self.debug_info,
224+
)?;
225+
}
226+
207227
self.get_and_write_testcase()?;
208228

209229
self.post_timeout_event()?;
@@ -236,6 +256,16 @@ impl Tsffs {
236256
self.coverage_enabled = true;
237257
self.save_initial_snapshot()?;
238258

259+
// Collect windows coverage info if enabled
260+
if self.windows && self.symbolic_coverage {
261+
self.windows_os_info.collect(
262+
processor,
263+
&self.debuginfo_download_directory,
264+
self.guess_pdb_function_size,
265+
&self.debug_info,
266+
)?;
267+
}
268+
239269
self.post_timeout_event()?;
240270
}
241271

@@ -571,7 +601,7 @@ impl Tsffs {
571601
) -> Result<()> {
572602
trace!(
573603
self.as_conf_object(),
574-
"on_magic_instruction({magic_number})"
604+
"Got magic instruction with magic #{magic_number})"
575605
);
576606

577607
if object_is_processor(trigger_obj)? {
@@ -629,4 +659,15 @@ impl Tsffs {
629659

630660
Ok(())
631661
}
662+
663+
pub fn on_control_register_write(
664+
&mut self,
665+
trigger_obj: *mut ConfObject,
666+
register_nr: i64,
667+
value: i64,
668+
) -> Result<()> {
669+
self.on_control_register_write_windows_symcov(trigger_obj, register_nr, value)?;
670+
671+
Ok(())
672+
}
632673
}

0 commit comments

Comments
 (0)