VirtualBox

Changeset 46155 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 18, 2013 12:30:13 AM (12 years ago)
Author:
vboxsync
Message:

List near, unassemble, hyper register and more tiny debugger fixes.

Location:
trunk/src/VBox/VMM/VMMR3
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGF.cpp

    r45701 r46155  
    963963
    964964    /*
    965      * Check if attached.
     965     * Validate input. The UVM handle shall be valid, the VM handle might be
     966     * in the processes of being destroyed already, so deal quietly with that.
    966967     */
    967968    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    968969    PVM pVM = pUVM->pVM;
    969     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     970    if (!VM_IS_VALID_EXT(pVM))
     971        return VERR_INVALID_VM_HANDLE;
     972
     973    /*
     974     * Check if attached.
     975     */
    970976    AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
    971977
  • trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp

    r45753 r46155  
    116116        DBGFSELINFO SelInfo;
    117117        int rc = DBGFR3SelQueryInfo(pUVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
     118        if (RT_FAILURE(rc) && !HMIsEnabled(pUVM->pVM))
     119            rc = DBGFR3SelQueryInfo(pUVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_SHADOW, &SelInfo);
    118120        if (RT_FAILURE(rc))
    119121            return rc;
     
    121123        if (RT_FAILURE(rc))
    122124            return rc;
     125        if (   (SelInfo.fFlags & DBGFSELINFO_FLAGS_HYPER)
     126            || dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
     127            pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
    123128    }
    124129    else
     
    126131        pAddress->FlatPtr = off;
    127132        pAddress->fFlags = DBGFADDRESS_FLAGS_FLAT;
     133        if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
     134            pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
    128135    }
    129136    pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID;
    130     if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
    131         pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
    132137
    133138    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp

    r46137 r46155  
    10881088 * @param   hDbgAs          The address space handle.
    10891089 * @param   pAddress        The address to lookup.
     1090 * @param   fFlags          One of the RTDBGSYMADDR_FLAGS_XXX flags.
    10901091 * @param   poffDisp        Where to return the distance between the returned
    10911092 *                          symbol and pAddress. Optional.
     
    10951096 * @param   phMod           Where to return the module handle. Optional.
    10961097 */
    1097 VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress,
     1098VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, uint32_t fFlags,
    10981099                                    PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
    10991100{
     
    11031104    if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL)
    11041105    {
    1105         int rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod);
     1106        int rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_RC, pAddress, fFlags, poffDisp, pSymbol, phMod);
    11061107        if (RT_FAILURE(rc))
    1107             rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod);
     1108            rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_GLOBAL, pAddress, fFlags, poffDisp, pSymbol, phMod);
    11081109        return rc;
    11091110    }
     
    11291130     */
    11301131    RTDBGMOD hMod;
    1131     int rc = RTDbgAsSymbolByAddr(hRealAS, pAddress->FlatPtr, RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL, poffDisp, pSymbol, &hMod);
     1132    int rc = RTDbgAsSymbolByAddr(hRealAS, pAddress->FlatPtr, fFlags, poffDisp, pSymbol, &hMod);
    11321133    if (RT_SUCCESS(rc))
    11331134    {
     
    11881189 * @param   hDbgAs          See DBGFR3AsSymbolByAddr.
    11891190 * @param   pAddress        See DBGFR3AsSymbolByAddr.
     1191 * @param   fFlags          See DBGFR3AsSymbolByAddr.
    11901192 * @param   poffDisp        See DBGFR3AsSymbolByAddr.
    11911193 * @param   phMod           See DBGFR3AsSymbolByAddr.
    11921194 */
    1193 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod)
     1195VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, uint32_t fFlags,
     1196                                              PRTGCINTPTR poffDisp, PRTDBGMOD phMod)
    11941197{
    11951198    RTDBGSYMBOL SymInfo;
    1196     int rc = DBGFR3AsSymbolByAddr(pUVM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod);
     1199    int rc = DBGFR3AsSymbolByAddr(pUVM, hDbgAs, pAddress, fFlags, poffDisp, &SymInfo, phMod);
    11971200    if (RT_SUCCESS(rc))
    11981201        return RTDbgSymbolDup(&SymInfo);
  • trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp

    r45753 r46155  
    301301        rc = DBGFR3AddrFromSelInfoOff(pState->pVM->pUVM, &Addr, pSelInfo, uAddress);
    302302        if (RT_SUCCESS(rc))
    303             rc = DBGFR3AsSymbolByAddr(pState->pVM->pUVM, pState->hAs, &Addr, &off, &Sym, NULL /*phMod*/);
     303            rc = DBGFR3AsSymbolByAddr(pState->pVM->pUVM, pState->hAs, &Addr, RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL,
     304                                      &off, &Sym, NULL /*phMod*/);
    304305    }
    305306    else
     
    359360    else if (fFlags & DBGF_DISAS_FLAGS_CURRENT_HYPER)
    360361    {
     362        fFlags    |= DBGF_DISAS_FLAGS_HYPER;
    361363        pCtxCore   = CPUMGetHyperCtxCore(pVCpu);
    362364        Sel        = pCtxCore->cs.Sel;
     
    449451        }
    450452    }
    451     else if (   !(fFlags & DBGF_DISAS_FLAGS_CURRENT_HYPER)
     453    else if (   !(fFlags & DBGF_DISAS_FLAGS_HYPER)
    452454             && (   (pCtxCore && pCtxCore->eflags.Bits.u1VM)
    453455                 || enmMode == PGMMODE_REAL
     
    474476    else
    475477    {
    476         rc = SELMR3GetSelectorInfo(pVM, pVCpu, Sel, &SelInfo);
     478        if (!(fFlags & DBGF_DISAS_FLAGS_HYPER))
     479            rc = SELMR3GetSelectorInfo(pVM, pVCpu, Sel, &SelInfo);
     480        else
     481            rc = SELMR3GetShadowSelectorInfo(pVM, Sel, &SelInfo);
    477482        if (RT_FAILURE(rc))
    478483        {
  • trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp

    r44691 r46155  
    12931293     * Resolve the register.
    12941294     */
    1295     bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
     1295    bool fGuestRegs = true;
     1296    if ((idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY)
     1297    {
     1298        fGuestRegs = false;
     1299        idDefCpu &= ~DBGFREG_HYPER_VMCPUID;
     1300    }
     1301
    12961302    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
    12971303    if (!pLookupRec)
     
    14481454     * Resolve the register and call the getter on the relevant CPU.
    14491455     */
    1450     bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
     1456    bool fGuestRegs = true;
     1457    if ((idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY)
     1458    {
     1459        fGuestRegs = false;
     1460        idDefCpu &= ~DBGFREG_HYPER_VMCPUID;
     1461    }
    14511462    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
    14521463    if (pLookupRec)
  • trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp

    r44528 r46155  
    157157        if (DBGFADDRESS_IS_VALID(&pFrame->AddrPC))
    158158        {
    159             pFrame->pSymPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrPC, NULL /*offDisp*/, NULL /*phMod*/);
     159            pFrame->pSymPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrPC, RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL,
     160                                                    NULL /*offDisp*/, NULL /*phMod*/);
    160161            pFrame->pLinePC = DBGFR3LineByAddrAlloc(pUVM, pFrame->AddrPC.FlatPtr, NULL);
    161162        }
     
    253254    }
    254255
    255     pFrame->pSymReturnPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrReturnPC, NULL /*offDisp*/, NULL /*phMod*/);
     256    pFrame->pSymReturnPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrReturnPC, RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL,
     257                                                  NULL /*offDisp*/, NULL /*phMod*/);
    256258    pFrame->pLineReturnPC = DBGFR3LineByAddrAlloc(pUVM, pFrame->AddrReturnPC.FlatPtr, NULL);
    257259
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r45858 r46155  
    24042404                    if (rc != VINF_SUCCESS)
    24052405                    {
    2406                         /* switch to guru meditation mode */
    2407                         pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION;
    2408                         VMMR3FatalDump(pVM, pVCpu, rc);
     2406                        if (rc == VINF_EM_OFF || rc == VINF_EM_TERMINATE)
     2407                            pVCpu->em.s.enmState = EMSTATE_TERMINATING;
     2408                        else
     2409                        {
     2410                            /* switch to guru meditation mode */
     2411                            pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION;
     2412                            VMMR3FatalDump(pVM, pVCpu, rc);
     2413                        }
    24092414                        Log(("EMR3ExecuteVM: actually returns %Rrc (state %s / %s)\n", rc, emR3GetStateName(pVCpu->em.s.enmState), emR3GetStateName(enmOldState)));
    24102415                        return rc;
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