On 05/03/2011 05:59 PM, Max Filippov wrote:
> +static void gen_jump(DisasContext *dc, TCGv dest)
> +{
> +    tcg_gen_mov_i32(cpu_pc, dest);
> +    if (dc->singlestep_enabled) {
> +        gen_exception(EXCP_DEBUG);
> +    }
> +    tcg_gen_exit_tb(0);
> +    dc->is_jmp = DISAS_UPDATE;

You're generating useless instructions here.  The exception
is a noreturn function.  It performs a longjmp to back out
of the cpu loop.

Thus the exit_tb should be in an else here.

> +invalid_opcode:
> +    printf("INVALID(pc = %08x): %s:%d\n", dc->pc, __FILE__, __LINE__);

Don't printf.  Use the logging functions properly.


r~

Reply via email to