1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
use crate*;
;
// pub struct ClosureBasedTracer<
// I,
// F0: FnMut(&mut I, VmLocalStateData<'_>, &dyn Memory) -> (),
// F1: FnMut(&mut I, VmLocalStateData<'_>, AfterDecodingData, &dyn Memory) -> (),
// F2: FnMut(&mut I, VmLocalStateData<'_>, BeforeExecutionData, &dyn Memory) -> (),
// F3: FnMut(&mut I, VmLocalStateData<'_>, AfterExecutionData, &dyn Memory) -> (),
// const BEFORE_DECODING: bool,
// const AFTER_DECODING: bool,
// const BEFORE_EXECUTION: bool,
// const AFTER_EXECUTION: bool,
// > {
// pub inner_state: I,
// pub before_decoding: Option<F0>,
// pub after_decoding: Option<F1>,
// pub before_execution: Option<F2>,
// pub after_execution: Option<F3>,
// }
// impl<
// I: 'static,
// F0: FnMut(&mut I, VmLocalStateData<'_>, &dyn Memory) -> () + 'static,
// F1: FnMut(&mut I, VmLocalStateData<'_>, AfterDecodingData, &dyn Memory) -> () + 'static,
// F2: FnMut(&mut I, VmLocalStateData<'_>, BeforeExecutionData, &dyn Memory) -> () + 'static,
// F3: FnMut(&mut I, VmLocalStateData<'_>, AfterExecutionData, &dyn Memory) -> () + 'static,
// const BEFORE_DECODING: bool,
// const AFTER_DECODING: bool,
// const BEFORE_EXECUTION: bool,
// const AFTER_EXECUTION: bool,
// > Tracer for ClosureBasedTracer<I, F0, F1, F2, F3, BEFORE_DECODING, AFTER_DECODING, BEFORE_EXECUTION, AFTER_EXECUTION> {
// const CALL_BEFORE_DECODING: bool = BEFORE_DECODING;
// const CALL_AFTER_DECODING: bool = AFTER_DECODING;
// const CALL_BEFORE_EXECUTION: bool = BEFORE_EXECUTION;
// const CALL_AFTER_EXECUTION: bool = AFTER_EXECUTION;
// fn before_decoding(&mut self, state: VmLocalStateData<'_>, memory: &dyn Memory) {
// if let Some(c) = self.before_decoding.as_mut() {
// (c)(&mut self.inner_state, state, memory)
// }
// }
// fn after_decoding(&mut self, state: VmLocalStateData<'_>, data: AfterDecodingData, memory: &dyn Memory) {
// if let Some(c) = self.after_decoding.as_mut() {
// c(&mut self.inner_state, state, data, memory)
// }
// }
// fn before_execution(&mut self, state: VmLocalStateData<'_>, data: BeforeExecutionData, memory: &dyn Memory) {
// if let Some(c) = self.before_execution.as_mut() {
// c(&mut self.inner_state, state, data, memory)
// }
// }
// fn after_execution(&mut self, state: VmLocalStateData<'_>, data: AfterExecutionData, memory: &dyn Memory) {
// if let Some(c) = self.after_execution.as_mut() {
// c(&mut self.inner_state, state, data, memory)
// }
// }
// }
// impl<
// I,
// F0: FnMut(&mut I, VmLocalStateData<'_>, &dyn Memory) -> (),
// F1: FnMut(&mut I, VmLocalStateData<'_>, AfterDecodingData, &dyn Memory) -> (),
// F2: FnMut(&mut I, VmLocalStateData<'_>, BeforeExecutionData, &dyn Memory) -> (),
// F3: FnMut(&mut I, VmLocalStateData<'_>, AfterExecutionData, &dyn Memory) -> (),
// const BEFORE_DECODING: bool,
// const AFTER_DECODING: bool,
// const BEFORE_EXECUTION: bool,
// const AFTER_EXECUTION: bool,
// > std::fmt::Debug for ClosureBasedTracer<I, F0, F1, F2, F3, BEFORE_DECODING, AFTER_DECODING, BEFORE_EXECUTION, AFTER_EXECUTION> {
// fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// f.debug_struct(&"ClosureBasedTracer")
// .finish()
// }
// }