Commit 956034d7e5370c26f8ef58a11e940ffa4f3d8d70
1 parent
6cd9f35b
log fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@105 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
2 deletions
exec-i386.c
@@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | #include "exec-i386.h" | 20 | #include "exec-i386.h" |
21 | +#include "disas.h" | ||
21 | 22 | ||
22 | //#define DEBUG_EXEC | 23 | //#define DEBUG_EXEC |
23 | #define DEBUG_FLUSH | 24 | #define DEBUG_FLUSH |
@@ -185,7 +186,7 @@ static void cpu_x86_dump_state(FILE *f) | @@ -185,7 +186,7 @@ static void cpu_x86_dump_state(FILE *f) | ||
185 | { | 186 | { |
186 | int eflags; | 187 | int eflags; |
187 | eflags = cc_table[CC_OP].compute_all(); | 188 | eflags = cc_table[CC_OP].compute_all(); |
188 | - eflags |= (DF & DIRECTION_FLAG); | 189 | + eflags |= (DF & DF_MASK); |
189 | fprintf(f, | 190 | fprintf(f, |
190 | "EAX=%08x EBX=%08X ECX=%08x EDX=%08x\n" | 191 | "EAX=%08x EBX=%08X ECX=%08x EDX=%08x\n" |
191 | "ESI=%08x EDI=%08X EBP=%08x ESP=%08x\n" | 192 | "ESI=%08x EDI=%08X EBP=%08x ESP=%08x\n" |
@@ -194,7 +195,7 @@ static void cpu_x86_dump_state(FILE *f) | @@ -194,7 +195,7 @@ static void cpu_x86_dump_state(FILE *f) | ||
194 | env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX], | 195 | env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX], |
195 | env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP], | 196 | env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP], |
196 | env->cc_src, env->cc_dst, cc_op_str[env->cc_op], | 197 | env->cc_src, env->cc_dst, cc_op_str[env->cc_op], |
197 | - eflags & DIRECTION_FLAG ? 'D' : '-', | 198 | + eflags & DF_MASK ? 'D' : '-', |
198 | eflags & CC_O ? 'O' : '-', | 199 | eflags & CC_O ? 'O' : '-', |
199 | eflags & CC_S ? 'S' : '-', | 200 | eflags & CC_S ? 'S' : '-', |
200 | eflags & CC_Z ? 'Z' : '-', | 201 | eflags & CC_Z ? 'Z' : '-', |
@@ -397,6 +398,12 @@ int cpu_x86_exec(CPUX86State *env1) | @@ -397,6 +398,12 @@ int cpu_x86_exec(CPUX86State *env1) | ||
397 | code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); | 398 | code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); |
398 | cpu_unlock(); | 399 | cpu_unlock(); |
399 | } | 400 | } |
401 | + if (loglevel) { | ||
402 | + fprintf(logfile, "Trace 0x%08lx [0x%08lx] %s\n", | ||
403 | + (long)tb->tc_ptr, (long)tb->pc, | ||
404 | + lookup_symbol((void *)tb->pc)); | ||
405 | + fflush(logfile); | ||
406 | + } | ||
400 | /* execute the generated code */ | 407 | /* execute the generated code */ |
401 | tc_ptr = tb->tc_ptr; | 408 | tc_ptr = tb->tc_ptr; |
402 | gen_func = (void *)tc_ptr; | 409 | gen_func = (void *)tc_ptr; |