@@ -8,6 +8,7 @@ use std::time::SystemTime;
88use crate :: {
99 arch:: ArchitectureOperations ,
1010 magic:: MagicNumber ,
11+ os:: DebugInfoConfig ,
1112 state:: { SolutionKind , StopReason } ,
1213 ManualStartInfo , Tsffs ,
1314} ;
@@ -29,6 +30,7 @@ impl Tsffs {
2930 let start_processor = self
3031 . start_processor ( )
3132 . ok_or_else ( || anyhow ! ( "No start processor" ) ) ?;
33+ let start_processor_raw = start_processor. cpu ( ) ;
3234
3335 let start_info = match magic_number {
3436 MagicNumber :: StartBufferPtrSizePtr => {
@@ -54,6 +56,20 @@ impl Tsffs {
5456 . map_err ( |_| anyhow ! ( "Failed to set start time" ) ) ?;
5557 self . coverage_enabled = true ;
5658 self . save_initial_snapshot ( ) ?;
59+ // Collect windows coverage info if enabled
60+ if self . windows && self . symbolic_coverage {
61+ info ! ( self . as_conf_object( ) , "Collecting initial coverage info" ) ;
62+ self . windows_os_info . collect (
63+ start_processor_raw,
64+ & self . debuginfo_download_directory ,
65+ & mut DebugInfoConfig {
66+ system : self . symbolic_coverage_system ,
67+ user_debug_info : & self . debug_info ,
68+ coverage : & mut self . coverage ,
69+ } ,
70+ & self . source_file_cache ,
71+ ) ?;
72+ }
5773 self . get_and_write_testcase ( ) ?;
5874 self . post_timeout_event ( ) ?;
5975 }
@@ -157,6 +173,10 @@ impl Tsffs {
157173 self . save_execution_trace ( ) ?;
158174 }
159175
176+ if self . symbolic_coverage {
177+ self . save_symbolic_coverage ( ) ?;
178+ }
179+
160180 debug ! ( self . as_conf_object( ) , "Resuming simulation" ) ;
161181
162182 run_alone ( || {
@@ -204,6 +224,21 @@ impl Tsffs {
204224 self . coverage_enabled = true ;
205225 self . save_initial_snapshot ( ) ?;
206226
227+ // Collect windows coverage info if enabled
228+ if self . windows && self . symbolic_coverage {
229+ info ! ( self . as_conf_object( ) , "Collecting initial coverage info" ) ;
230+ self . windows_os_info . collect (
231+ processor,
232+ & self . debuginfo_download_directory ,
233+ & mut DebugInfoConfig {
234+ system : self . symbolic_coverage_system ,
235+ user_debug_info : & self . debug_info ,
236+ coverage : & mut self . coverage ,
237+ } ,
238+ & self . source_file_cache ,
239+ ) ?;
240+ }
241+
207242 self . get_and_write_testcase ( ) ?;
208243
209244 self . post_timeout_event ( ) ?;
@@ -236,6 +271,21 @@ impl Tsffs {
236271 self . coverage_enabled = true ;
237272 self . save_initial_snapshot ( ) ?;
238273
274+ // Collect windows coverage info if enabled
275+ if self . windows && self . symbolic_coverage {
276+ info ! ( self . as_conf_object( ) , "Collecting initial coverage info" ) ;
277+ self . windows_os_info . collect (
278+ processor,
279+ & self . debuginfo_download_directory ,
280+ & mut DebugInfoConfig {
281+ system : self . symbolic_coverage_system ,
282+ user_debug_info : & self . debug_info ,
283+ coverage : & mut self . coverage ,
284+ } ,
285+ & self . source_file_cache ,
286+ ) ?;
287+ }
288+
239289 self . post_timeout_event ( ) ?;
240290 }
241291
@@ -334,6 +384,10 @@ impl Tsffs {
334384 self . save_execution_trace ( ) ?;
335385 }
336386
387+ if self . symbolic_coverage {
388+ self . save_symbolic_coverage ( ) ?;
389+ }
390+
337391 debug ! ( self . as_conf_object( ) , "Resuming simulation" ) ;
338392
339393 run_alone ( || {
@@ -435,6 +489,10 @@ impl Tsffs {
435489 self . save_execution_trace ( ) ?;
436490 }
437491
492+ if self . symbolic_coverage {
493+ self . save_symbolic_coverage ( ) ?;
494+ }
495+
438496 debug ! ( self . as_conf_object( ) , "Resuming simulation" ) ;
439497
440498 run_alone ( || {
@@ -571,7 +629,7 @@ impl Tsffs {
571629 ) -> Result < ( ) > {
572630 trace ! (
573631 self . as_conf_object( ) ,
574- "on_magic_instruction( {magic_number})"
632+ "Got magic instruction with magic # {magic_number})"
575633 ) ;
576634
577635 if object_is_processor ( trigger_obj) ? {
@@ -629,4 +687,15 @@ impl Tsffs {
629687
630688 Ok ( ( ) )
631689 }
690+
691+ pub fn on_control_register_write (
692+ & mut self ,
693+ trigger_obj : * mut ConfObject ,
694+ register_nr : i64 ,
695+ value : i64 ,
696+ ) -> Result < ( ) > {
697+ self . on_control_register_write_windows_symcov ( trigger_obj, register_nr, value) ?;
698+
699+ Ok ( ( ) )
700+ }
632701}
0 commit comments