@@ -9,7 +9,7 @@ use crate::state::{
9
9
} ;
10
10
11
11
use crate :: sims:: syscall:: syscall;
12
- use crate :: sims:: SimMethod ;
12
+ use crate :: sims:: { Sim , SimMethod } ;
13
13
14
14
use std:: collections:: BinaryHeap ;
15
15
use std:: mem;
@@ -47,7 +47,7 @@ pub struct Processor {
47
47
pub instructions : BTreeMap < u64 , InstructionEntry > ,
48
48
pub hooks : HashMap < u64 , Vec < HookMethod > > ,
49
49
pub esil_hooks : HashMap < u64 , Vec < String > > ,
50
- pub sims : HashMap < u64 , SimMethod > ,
50
+ pub sims : HashMap < u64 , Sim > ,
51
51
pub traps : HashMap < u64 , SimMethod > ,
52
52
pub interrupts : HashMap < u64 , SimMethod > ,
53
53
pub syscalls : HashMap < u64 , Syscall > ,
@@ -206,9 +206,8 @@ impl Processor {
206
206
207
207
/// print instruction if debug output is enabled
208
208
pub fn print_instr ( & self , state : & mut State , instr : & Instruction ) {
209
- if self . sims . contains_key ( & instr. offset ) {
210
- let flag = state. r2api . cmd ( & format ! ( "fd @ {}" , instr. offset) ) . unwrap_or_default ( ) ;
211
- println ! ( "\n 0x{:08x} ( {} )\n " , instr. offset, "simulated " . to_owned( ) + & flag. trim( ) ) ;
209
+ if let Some ( sim) = self . sims . get ( & instr. offset ) {
210
+ println ! ( "\n 0x{:08x} ( {} )\n " , instr. offset, "simulated " . to_owned( ) + & sim. symbol) ;
212
211
} else if !self . color {
213
212
println ! (
214
213
"0x{:08x} {:<40} | {}" ,
@@ -584,7 +583,7 @@ impl Processor {
584
583
let cc = state. r2api . get_cc ( pc) . unwrap_or_default ( ) ;
585
584
let args = self . get_args ( state, & cc) ;
586
585
587
- let ret = sim ( state, & args) ;
586
+ let ret = ( sim. function ) ( state, & args) ;
588
587
state. registers . set_with_alias ( cc. ret . as_str ( ) , ret) ;
589
588
590
589
// don't ret if sim changes the PC value
0 commit comments