diff --git a/qemu/cpus.c b/qemu/cpus.c index a0e9435f..68090a9b 100644 --- a/qemu/cpus.c +++ b/qemu/cpus.c @@ -77,7 +77,7 @@ void pause_all_vcpus(struct uc_struct *uc) CPUState *cpu; CPU_FOREACH(cpu) { - qemu_thread_join(uc, cpu->thread); // qq: fix qemu_thread_join() to work for instance + qemu_thread_join(uc, cpu->thread); free(cpu->thread); cpu->thread = NULL; } @@ -149,17 +149,6 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) } while (1) { -#if 0 - int count = 0; - if (count < 10) { - count++; - unsigned int eip = X86_CPU(mycpu)->env.eip; - printf(">>> current EIP = %x\n", eip); - printf(">>> ECX = %x\n", (unsigned int)X86_CPU(mycpu)->env.regs[R_ECX]); - printf(">>> EDX = %x\n", (unsigned int)X86_CPU(mycpu)->env.regs[R_EDX]); - } -#endif - if (tcg_exec_all(uc)) break; } @@ -170,7 +159,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) qemu_cond_destroy(cpu->halt_cond); free(cpu->halt_cond); #ifdef _WIN32 - if(cpu->hThread) + if (cpu->hThread) CloseHandle(cpu->hThread); #endif cpu->halt_cond = NULL; diff --git a/qemu/unicorn_common.h b/qemu/unicorn_common.h index a09253d3..adccbe01 100644 --- a/qemu/unicorn_common.h +++ b/qemu/unicorn_common.h @@ -78,17 +78,15 @@ static void release_common(void *t) g_free(uc->system_memory); - if(uc->qemu_thread_data) + if (uc->qemu_thread_data) free(uc->qemu_thread_data); #if TCG_TARGET_REG_BITS == 32 - for(int i = 0; i < s->nb_globals; i++) - { + for(int i = 0; i < s->nb_globals; i++) { TCGTemp *ts = &s->temps[i]; - if(ts->base_type == TCG_TYPE_I64) - { - if(ts->name && ((strcmp(ts->name+(strlen(ts->name)-2), "_0") == 0) || (strcmp(ts->name+(strlen(ts->name)-2), "_1") == 0))) - { + if (ts->base_type == TCG_TYPE_I64) { + if (ts->name && ((strcmp(ts->name+(strlen(ts->name)-2), "_0") == 0) || + (strcmp(ts->name+(strlen(ts->name)-2), "_1") == 0))) { free((void *)ts->name); } } diff --git a/qemu/vl.c b/qemu/vl.c index 34b0f40a..7cbfb065 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -107,8 +107,7 @@ int machine_initialize(struct uc_struct *uc) module_call_init(uc, MODULE_INIT_MACHINE); // this will auto initialize all register objects above. machine_class = find_default_machine(uc, uc->arch); - if(!uc->machine_state) - { + if (!uc->machine_state) { if (machine_class == NULL) { //fprintf(stderr, "No machine specified, and there is no default.\n" // "Use -machine help to list supported machines!\n"); diff --git a/uc.c b/uc.c index 14290e8e..04ae8dea 100644 --- a/uc.c +++ b/uc.c @@ -277,9 +277,6 @@ uc_err uc_close(uc_engine *uc) free(uc->ram_list.dirty_memory[i]); } - // TODO: remove uc->root (created with object_new()) - //uc->root->free(uc->root); - free(uc->hook_callbacks); free(uc->mapped_blocks);