remove UC_ERR_TIMEOUT, so timeout on uc_emu_start() is not considered error. added UC_QUERY_TIMEOUT to query exit reason

This commit is contained in:
Nguyen Anh Quynh
2020-05-24 23:54:45 +08:00
parent 216c348c35
commit fbef45b18f
11 changed files with 34 additions and 33 deletions

View File

@ -227,7 +227,7 @@ struct uc_struct {
bool stop_request; // request to immediately stop emulation - for uc_emu_stop()
bool quit_request; // request to quit the current TB, but continue to emulate - for uc_mem_protect()
bool emulation_done; // emulation is done by uc_emu_start()
bool timed_out; // emulation timed out, uc_emu_start() will result in EC_ERR_TIMEOUT
bool timed_out; // emulation timed out, that can retrieve via uc_query(UC_QUERY_TIMEOUT)
QemuThread timer; // timer for emulation timeout
uint64_t timeout; // timeout for uc_emu_start()

View File

@ -164,7 +164,6 @@ typedef enum uc_err {
UC_ERR_HOOK_EXIST, // hook for this event already existed
UC_ERR_RESOURCE, // Insufficient resource: uc_emu_start()
UC_ERR_EXCEPTION, // Unhandled CPU exception
UC_ERR_TIMEOUT // Emulation timed out
} uc_err;
@ -330,8 +329,9 @@ typedef struct uc_mem_region {
typedef enum uc_query_type {
// Dynamically query current hardware mode.
UC_QUERY_MODE = 1,
UC_QUERY_PAGE_SIZE,
UC_QUERY_ARCH,
UC_QUERY_PAGE_SIZE, // query pagesize of engine
UC_QUERY_ARCH, // query architecture of engine
UC_QUERY_TIMEOUT, // query if emulation stops because of timeout
} uc_query_type;
// Opaque storage for CPU context, used with uc_context_*()