diff options
| author | Ajax <commial@gmail.com> | 2017-01-06 11:22:31 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-01-06 11:24:00 +0100 |
| commit | 82da5885a0a2abc2769476ff85d376d6e3bbc229 (patch) | |
| tree | e8bb4a6b70e3b64892c52c8de2e282e939597ec6 /test/jitter/jit_options.py | |
| parent | be7e5073bd9817fcf8b26e0f64ed0df1bb4d4d4c (diff) | |
| download | miasm-82da5885a0a2abc2769476ff85d376d6e3bbc229.tar.gz miasm-82da5885a0a2abc2769476ff85d376d6e3bbc229.zip | |
Add a test for jit_maxline option
Diffstat (limited to 'test/jitter/jit_options.py')
| -rw-r--r-- | test/jitter/jit_options.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/jitter/jit_options.py b/test/jitter/jit_options.py index ee9c1afc..41f6b4b8 100644 --- a/test/jitter/jit_options.py +++ b/test/jitter/jit_options.py @@ -79,3 +79,25 @@ myjit.continue_run() assert myjit.run is True # Use a '<=' because it's a 'max_...' assert myjit.cpu.EAX <= 3 + +# Test 'jit_maxline' +print "[+] Run instr one by one" +myjit = init_jitter() +myjit.jit.options["jit_maxline"] = 1 +myjit.jit.options["max_exec_per_call"] = 1 + +counter = 0 +def cb(jitter): + global counter + counter += 1 + return True + +myjit.init_run(run_addr) +myjit.exec_cb = cb +myjit.continue_run() + +assert myjit.run is False +assert myjit.cpu.EAX == 0x10 +## dry(1) + main(1) + (loop_main(2) + loop_inc(2))*(0x10 - 1) + loop_main(2) + +## loop_end(1) = 65 +assert counter == 65 |