VirtualBox

Changeset 46217 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2013 1:02:37 PM (12 years ago)
Author:
vboxsync
Message:

Fixed the 'r', 'rg' and 'rg32' commands in 64-bit guest code.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp

    r46165 r46217  
    13941394
    13951395/**
    1396  * @interface_method_impl{FNDBCCMD, The 'rg', 'rg64' and 'rg32' commands.}
     1396 * @interface_method_impl{FNDBCCMD,
     1397 * The 'rg', 'rg64' and 'rg32' commands, worker for 'r'.}
    13971398 */
    13981399static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     
    14051406        PDBGC       pDbgc      = DBGC_CMDHLP2DBGC(pCmdHlp);
    14061407        bool const  f64BitMode = !strcmp(pCmd->pszCmd, "rg64")
    1407                               || (   !strcmp(pCmd->pszCmd, "rg32")
    1408                                   && CPUMIsGuestIn64BitCode(VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu)));
     1408                              || (   strcmp(pCmd->pszCmd, "rg32") != 0
     1409                                  && DBGFR3CpuIsIn64BitCode(pUVM, pDbgc->idCpu));
    14091410        char        szDisAndRegs[8192];
    14101411        int         rc;
  • trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp

    r46167 r46217  
    303303    return 1;
    304304}
     305VMMR3DECL(bool) DBGFR3CpuIsIn64BitCode(PUVM pUVM, VMCPUID idCpu)
     306{
     307    return false;
     308}
    305309
    306310VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile)
  • trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp

    r44529 r46217  
    7171
    7272/**
     73 * Wrapper around CPUMIsGuestIn64BitCode.
     74 *
     75 * @returns VINF_SUCCESS.
     76 * @param   pVM             Pointer to the VM.
     77 * @param   idCpu           The current CPU ID.
     78 * @param   pfIn64BitCode   Where to return the result.
     79 */
     80static DECLCALLBACK(int) dbgfR3CpuIn64BitCode(PVM pVM, VMCPUID idCpu, bool *pfIn64BitCode)
     81{
     82    Assert(idCpu == VMMGetCpuId(pVM));
     83    PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     84    *pfIn64BitCode = CPUMIsGuestIn64BitCode(pVCpu);
     85    return VINF_SUCCESS;
     86}
     87
     88
     89/**
     90 * Checks if the given CPU is executing 64-bit code or not.
     91 *
     92 * @returns true / false accordingly.
     93 * @param   pUVM        The user mode VM handle.
     94 * @param   idCpu       The target CPU ID.
     95 */
     96VMMR3DECL(bool) DBGFR3CpuIsIn64BitCode(PUVM pUVM, VMCPUID idCpu)
     97{
     98    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     99    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, false);
     100    AssertReturn(idCpu < pUVM->pVM->cCpus, false);
     101
     102    CPUMMODE fIn64BitCode;
     103    int rc = VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3CpuIn64BitCode, 3, pUVM->pVM, idCpu, &fIn64BitCode);
     104    if (RT_FAILURE(rc))
     105        return false;
     106    return fIn64BitCode;
     107}
     108
     109
     110/**
    73111 * Get the number of CPUs (or threads if you insist).
    74112 *
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