libscemu/
config.rs

1pub struct Config {
2    pub filename: String,       // filename with full path included
3    pub trace_mem: bool,        // show memory operations in every step.
4    pub trace_regs: bool,       // show all the regs in every step.
5    pub trace_reg: bool,        // show value and content of a reg in every step.
6    pub reg_names: Vec<String>, // which reg to trace.
7    pub verbose: u32,           // 0 only view the api, 1 api + messages, 2 asm code.
8    pub console: bool,          // enable the console on specific moment?.
9    pub console_num: u64,       // in which moment enable the console.
10    pub loops: bool,            // loop mode count the iterations for every instruction, its slow.
11    pub nocolors: bool,         // to redirecting the output to a file is better to remove colors.
12    pub trace_string: bool,
13    pub string_addr: u64,
14    pub inspect: bool,
15    pub inspect_seq: String,
16    pub endpoint: bool,
17    pub maps_folder: String,
18    pub console2: bool,
19    pub console_addr: u64,
20    pub entry_point: u64,
21    pub exit_position: u64,
22    pub code_base_addr: u64,
23    pub is_64bits: bool, // 64bits mode
24    pub stack_trace: bool,
25    pub test_mode: bool,
26    pub console_enabled: bool,
27    pub skip_unimplemented: bool,
28    pub stack_addr: u64,
29    pub trace_file: Option<std::fs::File>,
30}
31
32impl Config {
33    pub fn new() -> Config {
34        Config {
35            filename: String::new(),
36            trace_mem: false,
37            trace_regs: false,
38            trace_reg: false,
39            reg_names: Vec::new(),
40            verbose: 0,
41            console: false,
42            console_num: 0,
43            loops: false,
44            nocolors: false,
45            trace_string: false,
46            string_addr: 0,
47            inspect: false,
48            inspect_seq: "".to_string(),
49            endpoint: false,
50            maps_folder: "".to_string(),
51            console2: false,
52            console_addr: 0,
53            entry_point: 0x3c0000,
54            exit_position: 0,
55            code_base_addr: 0x3c0000,
56            is_64bits: false,
57            stack_trace: false,
58            test_mode: false,
59            console_enabled: true,
60            skip_unimplemented: false,
61            stack_addr: 0,
62            trace_file: None,
63        }
64    }
65}