mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-22 20:25:38 +00:00
python: handle UC_ERR_TIMEOUT, so sample_x86.py behaves like sample_x86.c
Backports commit 810bd34eef41078ca840be2e2ad82d762cb26fa5 from unicorn
This commit is contained in:
parent
784d580f01
commit
80a286cf8a
|
@ -383,8 +383,15 @@ def test_i386_loop():
|
||||||
print(">>> ECX = 0x%x" %r_ecx)
|
print(">>> ECX = 0x%x" %r_ecx)
|
||||||
print(">>> EDX = 0x%x" %r_edx)
|
print(">>> EDX = 0x%x" %r_edx)
|
||||||
|
|
||||||
|
|
||||||
except UcError as e:
|
except UcError as e:
|
||||||
|
# timeout is acceptable in this case
|
||||||
|
if e.errno == UC_ERR_TIMEOUT:
|
||||||
|
print(">>> Emulation done. Below is the CPU context")
|
||||||
|
r_ecx = mu.reg_read(UC_X86_REG_ECX)
|
||||||
|
r_edx = mu.reg_read(UC_X86_REG_EDX)
|
||||||
|
print(">>> ECX = 0x%x" %r_ecx)
|
||||||
|
print(">>> EDX = 0x%x" %r_edx)
|
||||||
|
else:
|
||||||
print("ERROR: %s" % e)
|
print("ERROR: %s" % e)
|
||||||
|
|
||||||
# Test X86 32 bit with IN/OUT instruction
|
# Test X86 32 bit with IN/OUT instruction
|
||||||
|
|
Loading…
Reference in a new issue