Support querying architecture mode besides arm (#1389)

This commit is contained in:
Bet4 2021-04-26 00:31:29 +08:00
parent e2a924a32b
commit 5f40667d91
2 changed files with 3 additions and 2 deletions

View File

@ -456,7 +456,7 @@ static uc_err arm_query(struct uc_struct *uc, uc_query_type type, size_t *result
// zero out ARM/THUMB mode
mode = uc->mode & ~(UC_MODE_ARM | UC_MODE_THUMB);
// THUMB mode or ARM MOde
mode += ((ARM_CPU(mycpu)->env.thumb != 0)? UC_MODE_THUMB : UC_MODE_ARM);
mode |= ((ARM_CPU(mycpu)->env.thumb != 0)? UC_MODE_THUMB : UC_MODE_ARM);
*result = mode;
return UC_ERR_OK;
default:

3
uc.c
View File

@ -1444,7 +1444,8 @@ uc_err uc_query(uc_engine *uc, uc_query_type type, size_t *result)
return uc->query(uc, type, result);
}
#endif
return UC_ERR_ARG;
*result = uc->mode;
break;
case UC_QUERY_TIMEOUT:
*result = uc->timed_out;