VirtualBox

Ignore:
Timestamp:
Jun 29, 2011 7:07:14 AM (13 years ago)
Author:
vboxsync
Message:

rem: Synced with v0.12.5.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxRecompiler.c

    r36811 r37675  
    310310    CPUMGetGuestCpuId(pVCpu, 0x80000001, &u32Dummy, &u32Dummy, &pVM->rem.s.Env.cpuid_ext3_features, &pVM->rem.s.Env.cpuid_ext2_features);
    311311
     312    cpu_reset(&pVM->rem.s.Env);
     313
    312314    /* allocate code buffer for single instruction emulation. */
    313315    pVM->rem.s.Env.cbCodeBuffer = 4096;
     
    315317    AssertMsgReturn(pVM->rem.s.Env.pvCodeBuffer, ("Failed to allocate code buffer!\n"), VERR_NO_MEMORY);
    316318
    317     /* finally, set the cpu_single_env global. */
     319    /* Finally, set the cpu_single_env global. */
    318320    cpu_single_env = &pVM->rem.s.Env;
    319321
     
    416418#ifdef DEBUG_ALL_LOGGING
    417419    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
    422422
    423423    /*
     
    999999                    CPUBreakpoint  *pBP;
    10001000                    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)
    10021002                        if (pBP->pc == GCPtrPC)
    10031003                            break;
     
    11821182                    CPUBreakpoint  *pBP;
    11831183                    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)
    11851185                        if (pBP->pc == GCPtrPC)
    11861186                            break;
     
    13401340                CPUBreakpoint  *pBP;
    13411341                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)
    13431343                    if (pBP->pc == GCPtrPC)
    13441344                        break;
     
    15311531    }
    15321532
    1533     if (!TAILQ_EMPTY(&env->breakpoints))
     1533    if (!QTAILQ_EMPTY(&env->breakpoints))
    15341534    {
    15351535        //Log2(("raw mode refused: Breakpoints\n"));
     
    15371537    }
    15381538
    1539     if (!TAILQ_EMPTY(&env->watchpoints))
     1539    if (!QTAILQ_EMPTY(&env->watchpoints))
    15401540    {
    15411541        //Log2(("raw mode refused: Watchpoints\n"));
     
    40024002void disas(FILE *phFile, void *pvCode, unsigned long cb)
    40034003{
    4004 #ifdef DEBUG_TMP_LOGGING
    4005 # define DISAS_PRINTF(x...) fprintf(phFile, x)
    4006 #else
    4007 # define DISAS_PRINTF(x...) RTLogPrintf(x)
    40084004    if (LogIs2Enabled())
    4009 #endif
    40104005    {
    40114006        unsigned        off = 0;
     
    40204015#endif
    40214016
    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);
    40234018        while (off < cb)
    40244019        {
    40254020            uint32_t cbInstr;
    40264021            if (RT_SUCCESS(DISInstr(&Cpu, (uintptr_t)pvCode + off, 0, &cbInstr, szOutput)))
    4027                 DISAS_PRINTF("%s", szOutput);
     4022                RTLogPrintf("%s", szOutput);
    40284023            else
    40294024            {
    4030                 DISAS_PRINTF("disas error\n");
     4025                RTLogPrintf("disas error\n");
    40314026                cbInstr = 1;
    40324027#ifdef RT_ARCH_AMD64 /** @todo remove when DISInstr starts supporting 64-bit code. */
     
    40374032        }
    40384033    }
    4039 
    4040 #undef  DISAS_PRINTF
    40414034}
    40424035
     
    40524045void target_disas(FILE *phFile, target_ulong uCode, target_ulong cb, int fFlags)
    40534046{
    4054 #ifdef DEBUG_TMP_LOGGING
    4055 # define DISAS_PRINTF(x...) fprintf(phFile, x)
    4056 #else
    4057 # define DISAS_PRINTF(x...) RTLogPrintf(x)
    40584047    if (LogIs2Enabled())
    4059 #endif
    40604048    {
    40614049        PVM         pVM = cpu_single_env->pVM;
     
    40744062         * Do the disassembling.
    40754063         */
    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);
    40774065        cs = cpu_single_env->segs[R_CS].selector;
    40784066        eip = uCode - cpu_single_env->segs[R_CS].base;
     
    40894077                                        &cbInstr);
    40904078            if (RT_SUCCESS(rc))
    4091                 DISAS_PRINTF("%llx %s\n", (uint64_t)uCode, szBuf);
     4079                RTLogPrintf("%llx %s\n", (uint64_t)uCode, szBuf);
    40924080            else
    40934081            {
    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);
    40954083                cbInstr = 1;
    40964084            }
     
    41044092        }
    41054093    }
    4106 #undef DISAS_PRINTF
    41074094}
    41084095
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette