Changeset 37675 in vbox for trunk/src/recompiler/VBoxRecompiler.c
- Timestamp:
- Jun 29, 2011 7:07:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/VBoxRecompiler.c
r36811 r37675 310 310 CPUMGetGuestCpuId(pVCpu, 0x80000001, &u32Dummy, &u32Dummy, &pVM->rem.s.Env.cpuid_ext3_features, &pVM->rem.s.Env.cpuid_ext2_features); 311 311 312 cpu_reset(&pVM->rem.s.Env); 313 312 314 /* allocate code buffer for single instruction emulation. */ 313 315 pVM->rem.s.Env.cbCodeBuffer = 4096; … … 315 317 AssertMsgReturn(pVM->rem.s.Env.pvCodeBuffer, ("Failed to allocate code buffer!\n"), VERR_NO_MEMORY); 316 318 317 /* finally, set the cpu_single_env global. */319 /* Finally, set the cpu_single_env global. */ 318 320 cpu_single_env = &pVM->rem.s.Env; 319 321 … … 416 418 #ifdef DEBUG_ALL_LOGGING 417 419 loglevel = ~0; 418 # ifdef DEBUG_TMP_LOGGING 419 logfile = fopen("/tmp/vbox-qemu.log", "w"); 420 # endif 421 #endif 420 #endif 421 //loglevel = CPU_LOG_EXEC | CPU_LOG_INT | CPU_LOG_PCALL | CPU_LOG_TB_CPU; /// DONT COMMIT ME 422 422 423 423 /* … … 999 999 CPUBreakpoint *pBP; 1000 1000 RTGCPTR GCPtrPC = pVM->rem.s.Env.eip + pVM->rem.s.Env.segs[R_CS].base; 1001 TAILQ_FOREACH(pBP, &pVM->rem.s.Env.breakpoints, entry)1001 QTAILQ_FOREACH(pBP, &pVM->rem.s.Env.breakpoints, entry) 1002 1002 if (pBP->pc == GCPtrPC) 1003 1003 break; … … 1182 1182 CPUBreakpoint *pBP; 1183 1183 RTGCPTR GCPtrPC = pVM->rem.s.Env.eip + pVM->rem.s.Env.segs[R_CS].base; 1184 TAILQ_FOREACH(pBP, &pVM->rem.s.Env.breakpoints, entry)1184 QTAILQ_FOREACH(pBP, &pVM->rem.s.Env.breakpoints, entry) 1185 1185 if (pBP->pc == GCPtrPC) 1186 1186 break; … … 1340 1340 CPUBreakpoint *pBP; 1341 1341 RTGCPTR GCPtrPC = pVM->rem.s.Env.eip + pVM->rem.s.Env.segs[R_CS].base; 1342 TAILQ_FOREACH(pBP, &pVM->rem.s.Env.breakpoints, entry)1342 QTAILQ_FOREACH(pBP, &pVM->rem.s.Env.breakpoints, entry) 1343 1343 if (pBP->pc == GCPtrPC) 1344 1344 break; … … 1531 1531 } 1532 1532 1533 if (! TAILQ_EMPTY(&env->breakpoints))1533 if (!QTAILQ_EMPTY(&env->breakpoints)) 1534 1534 { 1535 1535 //Log2(("raw mode refused: Breakpoints\n")); … … 1537 1537 } 1538 1538 1539 if (! TAILQ_EMPTY(&env->watchpoints))1539 if (!QTAILQ_EMPTY(&env->watchpoints)) 1540 1540 { 1541 1541 //Log2(("raw mode refused: Watchpoints\n")); … … 4002 4002 void disas(FILE *phFile, void *pvCode, unsigned long cb) 4003 4003 { 4004 #ifdef DEBUG_TMP_LOGGING4005 # define DISAS_PRINTF(x...) fprintf(phFile, x)4006 #else4007 # define DISAS_PRINTF(x...) RTLogPrintf(x)4008 4004 if (LogIs2Enabled()) 4009 #endif4010 4005 { 4011 4006 unsigned off = 0; … … 4020 4015 #endif 4021 4016 4022 DISAS_PRINTF("Recompiled Code: %p %#lx (%ld) bytes\n", pvCode, cb, cb);4017 RTLogPrintf("Recompiled Code: %p %#lx (%ld) bytes\n", pvCode, cb, cb); 4023 4018 while (off < cb) 4024 4019 { 4025 4020 uint32_t cbInstr; 4026 4021 if (RT_SUCCESS(DISInstr(&Cpu, (uintptr_t)pvCode + off, 0, &cbInstr, szOutput))) 4027 DISAS_PRINTF("%s", szOutput);4022 RTLogPrintf("%s", szOutput); 4028 4023 else 4029 4024 { 4030 DISAS_PRINTF("disas error\n");4025 RTLogPrintf("disas error\n"); 4031 4026 cbInstr = 1; 4032 4027 #ifdef RT_ARCH_AMD64 /** @todo remove when DISInstr starts supporting 64-bit code. */ … … 4037 4032 } 4038 4033 } 4039 4040 #undef DISAS_PRINTF4041 4034 } 4042 4035 … … 4052 4045 void target_disas(FILE *phFile, target_ulong uCode, target_ulong cb, int fFlags) 4053 4046 { 4054 #ifdef DEBUG_TMP_LOGGING4055 # define DISAS_PRINTF(x...) fprintf(phFile, x)4056 #else4057 # define DISAS_PRINTF(x...) RTLogPrintf(x)4058 4047 if (LogIs2Enabled()) 4059 #endif4060 4048 { 4061 4049 PVM pVM = cpu_single_env->pVM; … … 4074 4062 * Do the disassembling. 4075 4063 */ 4076 DISAS_PRINTF("Guest Code: PC=%llx %llx bytes fFlags=%d\n", (uint64_t)uCode, (uint64_t)cb, fFlags);4064 RTLogPrintf("Guest Code: PC=%llx %llx bytes fFlags=%d\n", (uint64_t)uCode, (uint64_t)cb, fFlags); 4077 4065 cs = cpu_single_env->segs[R_CS].selector; 4078 4066 eip = uCode - cpu_single_env->segs[R_CS].base; … … 4089 4077 &cbInstr); 4090 4078 if (RT_SUCCESS(rc)) 4091 DISAS_PRINTF("%llx %s\n", (uint64_t)uCode, szBuf);4079 RTLogPrintf("%llx %s\n", (uint64_t)uCode, szBuf); 4092 4080 else 4093 4081 { 4094 DISAS_PRINTF("%llx %04x:%llx: %s\n", (uint64_t)uCode, cs, (uint64_t)eip, szBuf);4082 RTLogPrintf("%llx %04x:%llx: %s\n", (uint64_t)uCode, cs, (uint64_t)eip, szBuf); 4095 4083 cbInstr = 1; 4096 4084 } … … 4104 4092 } 4105 4093 } 4106 #undef DISAS_PRINTF4107 4094 } 4108 4095
Note:
See TracChangeset
for help on using the changeset viewer.