reset invalid_error after callbacks decide to continue after invalid memory accesses

This commit is contained in:
Nguyen Anh Quynh 2015-08-26 16:15:38 +08:00
parent 70cdbf8c69
commit 192f07c503
2 changed files with 11 additions and 0 deletions

View File

@ -198,6 +198,8 @@ WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx,
// printf("***** Invalid memory read at " TARGET_FMT_lx "\n", addr); // printf("***** Invalid memory read at " TARGET_FMT_lx "\n", addr);
cpu_exit(env->uc->current_cpu); cpu_exit(env->uc->current_cpu);
return 0; return 0;
} else {
env->invalid_error = UC_ERR_OK;
} }
} }
@ -233,6 +235,8 @@ WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx,
// printf("Invalid memory read at " TARGET_FMT_lx "\n", addr); // printf("Invalid memory read at " TARGET_FMT_lx "\n", addr);
cpu_exit(env->uc->current_cpu); cpu_exit(env->uc->current_cpu);
return 0; return 0;
} else {
env->invalid_error = UC_ERR_OK;
} }
/* ??? Note that the io helpers always read data in the target /* ??? Note that the io helpers always read data in the target
@ -316,6 +320,8 @@ WORD_TYPE helper_be_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx,
// printf("***** Invalid memory read at " TARGET_FMT_lx "\n", addr); // printf("***** Invalid memory read at " TARGET_FMT_lx "\n", addr);
cpu_exit(env->uc->current_cpu); cpu_exit(env->uc->current_cpu);
return 0; return 0;
} else {
env->invalid_error = UC_ERR_OK;
} }
} }
@ -474,6 +480,8 @@ void helper_le_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val,
// printf("***** Invalid memory write at " TARGET_FMT_lx "\n", addr); // printf("***** Invalid memory write at " TARGET_FMT_lx "\n", addr);
cpu_exit(env->uc->current_cpu); cpu_exit(env->uc->current_cpu);
return; return;
} else {
env->invalid_error = UC_ERR_OK;
} }
} }
@ -586,6 +594,8 @@ void helper_be_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val,
// printf("***** Invalid memory write at " TARGET_FMT_lx "\n", addr); // printf("***** Invalid memory write at " TARGET_FMT_lx "\n", addr);
cpu_exit(env->uc->current_cpu); cpu_exit(env->uc->current_cpu);
return; return;
} else {
env->invalid_error = UC_ERR_OK;
} }
} }

View File

@ -725,6 +725,7 @@ static void test_x86_16(void)
uc_close(&handle); uc_close(&handle);
} }
int main(int argc, char **argv, char **envp) int main(int argc, char **argv, char **envp)
{ {
if (argc == 2) { if (argc == 2) {