Revision 9de5e440 translate-i386.c

b/translate-i386.c
22 22
#include <stdio.h>
23 23
#include <string.h>
24 24
#include <inttypes.h>
25
#include <signal.h>
25 26
#include <assert.h>
26 27

  
27 28
#define DEBUG_DISAS
......
3487 3488
static uint16_t gen_opc_buf[OPC_BUF_SIZE];
3488 3489
static uint32_t gen_opparam_buf[OPPARAM_BUF_SIZE];
3489 3490

  
3490
/* return the next pc */
3491
/* return non zero if the very first instruction is invalid so that
3492
   the virtual CPU can trigger an exception. */
3491 3493
int cpu_x86_gen_code(uint8_t *gen_code_buf, int max_code_size, 
3492 3494
                     int *gen_code_size_ptr,
3493 3495
                     uint8_t *pc_start,  uint8_t *cs_base, int flags)
......
3519 3521
    do {
3520 3522
        ret = disas_insn(dc, pc_ptr);
3521 3523
        if (ret == -1) {
3522
            fprintf(stderr, "unknown instruction at PC=0x%08lx B=%02x %02x %02x", 
3523
                    (long)pc_ptr, pc_ptr[0], pc_ptr[1], pc_ptr[2]);
3524
            abort();
3524
            /* we trigger an illegal instruction operation only if it
3525
               is the first instruction. Otherwise, we simply stop
3526
               generating the code just before it */
3527
            if (pc_ptr == pc_start)
3528
                return -1;
3529
            else
3530
                break;
3525 3531
        }
3526 3532
        pc_ptr = (void *)ret;
3527 3533
    } while (!dc->is_jmp && gen_opc_ptr < gen_opc_end);
......
3640 3646
        env->fptags[i] = 1;
3641 3647
    env->fpuc = 0x37f;
3642 3648
    /* flags setup */
3643
    env->cc_op = CC_OP_EFLAGS;
3644
    env->df = 1;
3649
    env->eflags = 0;
3645 3650

  
3646 3651
    /* init various static tables */
3647 3652
    if (!inited) {

Also available in: Unified diff