From 192f07c503f8e99e7a17d5fa488225d2175112a7 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Wed, 26 Aug 2015 16:15:38 +0800 Subject: [PATCH] reset invalid_error after callbacks decide to continue after invalid memory accesses --- qemu/softmmu_template.h | 10 ++++++++++ samples/sample_x86.c | 1 + 2 files changed, 11 insertions(+) diff --git a/qemu/softmmu_template.h b/qemu/softmmu_template.h index 3fca97ec..5ae4a73f 100644 --- a/qemu/softmmu_template.h +++ b/qemu/softmmu_template.h @@ -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); cpu_exit(env->uc->current_cpu); 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); cpu_exit(env->uc->current_cpu); return 0; + } else { + env->invalid_error = UC_ERR_OK; } /* ??? 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); cpu_exit(env->uc->current_cpu); 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); cpu_exit(env->uc->current_cpu); 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); cpu_exit(env->uc->current_cpu); return; + } else { + env->invalid_error = UC_ERR_OK; } } diff --git a/samples/sample_x86.c b/samples/sample_x86.c index b0dec117..4e4a736d 100644 --- a/samples/sample_x86.c +++ b/samples/sample_x86.c @@ -725,6 +725,7 @@ static void test_x86_16(void) uc_close(&handle); } + int main(int argc, char **argv, char **envp) { if (argc == 2) {