--- np2/i386c/ia32/cpu.c 2004/01/13 16:38:49 1.3 +++ np2/i386c/ia32/cpu.c 2004/01/15 15:50:33 1.5 @@ -1,4 +1,4 @@ -/* $Id: cpu.c,v 1.3 2004/01/13 16:38:49 monaka Exp $ */ +/* $Id: cpu.c,v 1.5 2004/01/15 15:50:33 monaka Exp $ */ /* * Copyright (c) 2002-2003 NONAKA Kimihiro @@ -199,6 +199,7 @@ show_profile_ea(void) #ifdef IA32_INSTRUCTION_TRACE static FILE *fp = NULL; +BOOL cpu_inst_trace = FALSE; static const char *opcode_1byte[2][256] = { /* 16bit */ @@ -650,11 +651,18 @@ exec_1step(void) DWORD eip = CPU_EIP; int num = 0; int i; + BOOL t = cpu_inst_trace; - if (fp == NULL) { + if ((CPU_CS == 0x0018) && (eip >= 0x0000b42c) && (eip <= 0x0000b435)) { + t = FALSE; + } + + if ((fp == NULL) && t) { fp = fopen("ia32trace.txt", "a"); } - fprintf(fp, "%04x:%08x:", CPU_CS, CPU_EIP); + if (fp && t) { + fprintf(fp, "%04x:%08x:", CPU_CS, eip); + } #endif for (prefix = 0; prefix < MAX_PREFIX; prefix++) { @@ -662,7 +670,7 @@ exec_1step(void) #ifdef IA32_INSTRUCTION_TRACE eip++; - if (fp) { + if (fp && t) { opcode[num++] = op; fprintf(fp, " %02x", op); } @@ -682,7 +690,7 @@ exec_1step(void) PROFILE_INC_INST_1BYTE(op); #ifdef IA32_INSTRUCTION_TRACE - if (fp) { + if (fp && t) { BYTE op2 = 0; if ((op == 0x0f) || (op >= 0x80 && op <= 0x83)