VirtualBox

Changeset 93470 in vbox for trunk/src


Ignore:
Timestamp:
Jan 27, 2022 11:51:28 PM (3 years ago)
Author:
vboxsync
Message:

DbgPlugInDiggers,VMM,Main: Refactored the diggers and related interfaces to work via the VMM function table. Removed non-working tstVBoxDbg (needs proper COM now). bugref:10072

Location:
trunk/src/VBox
Files:
1 deleted
21 edited

Legend:

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

    r93115 r93470  
    10931093        if (pszBuf)
    10941094        {
    1095             rc = pDmesg->pfnQueryKernelLog(pDmesg, pUVM, 0 /*fFlags*/, cMessages, pszBuf, cbBuf, &cbActual);
     1095            rc = pDmesg->pfnQueryKernelLog(pDmesg, pUVM, VMMR3GetVTable(), 0 /*fFlags*/, cMessages, pszBuf, cbBuf, &cbActual);
    10961096
    10971097            uint32_t cTries = 10;
     
    11061106                    break;
    11071107                }
    1108                 rc = pDmesg->pfnQueryKernelLog(pDmesg, pUVM, 0 /*fFlags*/, cMessages, pszBuf, cbBuf, &cbActual);
     1108                rc = pDmesg->pfnQueryKernelLog(pDmesg, pUVM, VMMR3GetVTable(), 0 /*fFlags*/, cMessages, pszBuf, cbBuf, &cbActual);
    11091109            }
    11101110            if (RT_SUCCESS(rc))
  • trunk/src/VBox/Debugger/DBGCRemoteKd.cpp

    r93115 r93470  
    27502750    if (pThis->pIfWinNt)
    27512751    {
    2752         int rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM,
     2752        int rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(),
    27532753                                                  NULL /*puVersMajor*/, NULL /*puVersMinor*/,
    27542754                                                  &NtBuildNumber, &f32Bit);
    27552755        if (RT_SUCCESS(rc))
    2756             rc = pThis->pIfWinNt->pfnQueryKernelPtrs(pThis->pIfWinNt, pThis->Dbgc.pUVM, &Resp.u.GetVersion.u64PtrKernBase,
     2756            rc = pThis->pIfWinNt->pfnQueryKernelPtrs(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(),
     2757                                                     &Resp.u.GetVersion.u64PtrKernBase,
    27572758                                                     &Resp.u.GetVersion.u64PtrPsLoadedModuleList);
    27582759    }
     
    30283029                    RTGCUINTPTR GCPtrKpcr = 0;
    30293030
    3030                     rc = pThis->pIfWinNt->pfnQueryKpcrForVCpu(pThis->pIfWinNt, pThis->Dbgc.pUVM, RespHdr.idCpu,
     3031                    rc = pThis->pIfWinNt->pfnQueryKpcrForVCpu(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(), RespHdr.idCpu,
    30313032                                                              &GCPtrKpcr, NULL /*pKpcrb*/);
    30323033                    if (RT_SUCCESS(rc))
     
    30433044                    RTGCUINTPTR GCPtrKpcrb = 0;
    30443045
    3045                     rc = pThis->pIfWinNt->pfnQueryKpcrForVCpu(pThis->pIfWinNt, pThis->Dbgc.pUVM, RespHdr.idCpu,
     3046                    rc = pThis->pIfWinNt->pfnQueryKpcrForVCpu(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(), RespHdr.idCpu,
    30463047                                                              NULL /*pKpcr*/, &GCPtrKpcrb);
    30473048                    if (RT_SUCCESS(rc))
     
    30653066                    RTGCUINTPTR GCPtrCurThrd = 0;
    30663067
    3067                     rc = pThis->pIfWinNt->pfnQueryCurThrdForVCpu(pThis->pIfWinNt, pThis->Dbgc.pUVM, RespHdr.idCpu,
    3068                                                                  &GCPtrCurThrd);
     3068                    rc = pThis->pIfWinNt->pfnQueryCurThrdForVCpu(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(),
     3069                                                                 RespHdr.idCpu, &GCPtrCurThrd);
    30693070                    if (RT_SUCCESS(rc))
    30703071                        memcpy(&abResp[0], &GCPtrCurThrd, sizeof(GCPtrCurThrd));
     
    35863587    if (pThis->pIfWinNt)
    35873588    {
    3588         rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM,
     3589        rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(),
    35893590                                              NULL /*puVersMajor*/, NULL /*puVersMinor*/,
    35903591                                              NULL /*puBuildNumber*/, &pThis->f32Bit);
  • trunk/src/VBox/Debugger/DBGPlugInCommonELF.cpp

    r93115 r93470  
    2323#include "DBGPlugInCommonELF.h"
    2424
    25 #include <VBox/vmm/dbgf.h>
     25#include <VBox/vmm/vmmr3vtable.h>
    2626#include <iprt/alloca.h>
    2727#include <iprt/asm.h>
  • trunk/src/VBox/Debugger/DBGPlugInCommonELF.h

    r93115 r93470  
    3838/** @} */
    3939
    40 int DBGDiggerCommonParseElf32Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
     40int DBGDiggerCommonParseElf32Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
    4141                                 Elf32_Ehdr const *pEhdr, Elf32_Shdr const *paShdrs,
    4242                                 Elf32_Sym const *paSyms, size_t cMaxSyms,
     
    4444                                 RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag);
    4545
    46 int DBGDiggerCommonParseElf64Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
     46int DBGDiggerCommonParseElf64Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
    4747                                 Elf64_Ehdr const *pEhdr, Elf64_Shdr const *paShdrs,
    4848                                 Elf64_Sym const *paSyms, size_t cMaxSyms,
  • trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h

    r93115 r93470  
    4545 *
    4646 * @param   pUVM            The user mode VM handle.
     47 * @param   pVMM            The VMM function table.
    4748 * @param   pszModName      The module name.
    4849 * @param   pszFilename     The filename. optional.
     
    6970 * @param   uModTag         Module tag. Pass 0 if tagging is of no interest.
    7071 */
    71 int DBGDiggerCommonParseElfMod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
     72int DBGDiggerCommonParseElfMod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
    7273                               Elf_Ehdr const *pEhdr, Elf_Shdr const *paShdrs,
    7374                               Elf_Sym const *paSyms, size_t cMaxSyms,
     
    7677{
    7778    AssertPtrReturn(pUVM, VERR_INVALID_POINTER);
     79    AssertPtrReturn(pVMM, VERR_INVALID_POINTER);
    7880    AssertPtrReturn(pszModName, VERR_INVALID_POINTER);
    7981    AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
     
    315317     * Link it into the address space.
    316318     */
    317     RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     319    RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    318320    if (hAs != NIL_RTDBGAS)
    319321        rc = dbgDiggerCommonLinkElfSegs(hAs, hMod, paSegs, cSegs);
  • trunk/src/VBox/Debugger/DBGPlugInDarwin.cpp

    r93115 r93470  
    2222#define LOG_GROUP LOG_GROUP_DBGF /// @todo add new log group.
    2323#include "DBGPlugIns.h"
    24 #include <VBox/vmm/dbgf.h>
     24#include <VBox/vmm/vmmr3vtable.h>
    2525#include <iprt/err.h>
    2626#include <iprt/mem.h>
     
    132132*   Internal Functions                                                                                                           *
    133133*********************************************************************************************************************************/
    134 static DECLCALLBACK(int)  dbgDiggerDarwinInit(PUVM pUVM, void *pvData);
     134static DECLCALLBACK(int)  dbgDiggerDarwinInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData);
    135135
    136136
     
    139139 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog}
    140140 */
    141 static DECLCALLBACK(int) dbgDiggerDarwinIDmsg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, uint32_t fFlags, uint32_t cMessages,
    142                                                              char *pszBuf, size_t cbBuf, size_t *pcbActual)
     141static DECLCALLBACK(int) dbgDiggerDarwinIDmsg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, uint32_t fFlags,
     142                                                             uint32_t cMessages, char *pszBuf, size_t cbBuf, size_t *pcbActual)
    143143{
    144144    RT_NOREF1(fFlags);
     
    151151     * The 'msgbufp' variable points to a struct msgbuf (bsd/kern/subr_log.c).
    152152     */
    153     RTDBGAS  hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     153    RTDBGAS  hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    154154    RTDBGMOD hMod;
    155155    int rc = RTDbgAsModuleByName(hAs, "mach_kernel", 0, &hMod);
     
    164164    if (RT_SUCCESS(rc))
    165165    {
    166         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, SymInfo.Value + pData->AddrKernel.FlatPtr),
    167                            &GCPtrMsgBufP, pData->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t));
     166        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     167                                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SymInfo.Value + pData->AddrKernel.FlatPtr),
     168                                    &GCPtrMsgBufP, pData->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t));
    168169        if (RT_FAILURE(rc))
    169170        {
     
    204205        uint64_t msg_bufc; /**< Size depends on windows size. */
    205206    } MsgBuf;
    206     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrMsgBufP),
    207                        &MsgBuf, sizeof(MsgBuf) - (pData->f64Bit ? 0 : sizeof(uint32_t)) );
     207    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrMsgBufP),
     208                                &MsgBuf, sizeof(MsgBuf) - (pData->f64Bit ? 0 : sizeof(uint32_t)) );
    208209    if (RT_FAILURE(rc))
    209210    {
     
    239240        return VERR_INVALID_STATE;
    240241    }
    241     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, MsgBuf.msg_bufc), pchMsgBuf, MsgBuf.msg_size);
     242    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     243                                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, MsgBuf.msg_bufc), pchMsgBuf, MsgBuf.msg_size);
    242244    if (RT_SUCCESS(rc))
    243245    {
     
    312314 * @copydoc DBGFOSREG::pfnStackUnwindAssist
    313315 */
    314 static DECLCALLBACK(int) dbgDiggerDarwinStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,
    315                                                           PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,
    316                                                           uint64_t *puScratch)
    317 {
    318     RT_NOREF(pUVM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
     316static DECLCALLBACK(int) dbgDiggerDarwinStackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu,
     317                                                          PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx,
     318                                                          RTDBGAS hAs, uint64_t *puScratch)
     319{
     320    RT_NOREF(pUVM, pVMM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
    319321    return VINF_SUCCESS;
    320322}
     
    324326 * @copydoc DBGFOSREG::pfnQueryInterface
    325327 */
    326 static DECLCALLBACK(void *) dbgDiggerDarwinQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    327 {
    328     RT_NOREF1(pUVM);
     328static DECLCALLBACK(void *) dbgDiggerDarwinQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf)
     329{
     330    RT_NOREF(pUVM, pVMM);
    329331    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
    330332    switch (enmIf)
     
    342344 * @copydoc DBGFOSREG::pfnQueryVersion
    343345 */
    344 static DECLCALLBACK(int)  dbgDiggerDarwinQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
     346static DECLCALLBACK(int)  dbgDiggerDarwinQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData,
     347                                                      char *pszVersion, size_t cchVersion)
    345348{
    346349    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
     
    350353     * It's all in the linux banner.
    351354     */
    352     int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrKernelVersion, pszVersion, cchVersion);
     355    int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &pThis->AddrKernelVersion, pszVersion, cchVersion);
    353356    if (RT_SUCCESS(rc))
    354357    {
     
    370373 * @copydoc DBGFOSREG::pfnTerm
    371374 */
    372 static DECLCALLBACK(void)  dbgDiggerDarwinTerm(PUVM pUVM, void *pvData)
    373 {
    374     RT_NOREF1(pUVM);
     375static DECLCALLBACK(void)  dbgDiggerDarwinTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     376{
     377    RT_NOREF(pUVM, pVMM);
    375378    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
    376379
     
    382385 * @copydoc DBGFOSREG::pfnRefresh
    383386 */
    384 static DECLCALLBACK(int)  dbgDiggerDarwinRefresh(PUVM pUVM, void *pvData)
     387static DECLCALLBACK(int)  dbgDiggerDarwinRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    385388{
    386389    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
     
    391394     * For now we'll flush and reload everything.
    392395     */
    393     dbgDiggerDarwinTerm(pUVM, pvData);
    394     return dbgDiggerDarwinInit(pUVM, pvData);
     396    dbgDiggerDarwinTerm(pUVM, pVMM, pvData);
     397    return dbgDiggerDarwinInit(pUVM, pVMM, pvData);
    395398}
    396399
     
    402405 * @returns true if present, false if not.
    403406 * @param   pUVM                The user mode VM structure.
     407 * @param   pVMM                The VMM function table.
    404408 * @param   uSegAddr            The segment addresss.
    405409 * @param   cbSeg               The segment size.
     
    407411 * @param   uMaxAddr            Highest allowed address.
    408412 */
    409 static bool dbgDiggerDarwinIsSegmentPresent(PUVM pUVM, uint64_t uSegAddr, uint64_t cbSeg, uint64_t uMinAddr, uint64_t uMaxAddr)
     413static bool dbgDiggerDarwinIsSegmentPresent(PUVM pUVM, PCVMMR3VTABLE pVMM, uint64_t uSegAddr, uint64_t cbSeg,
     414                                            uint64_t uMinAddr, uint64_t uMaxAddr)
    410415{
    411416    /*
     
    449454        uint8_t     abBuf[8];
    450455        DBGFADDRESS Addr;
    451         int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, uSegAddr), abBuf, sizeof(abBuf));
     456        int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uSegAddr),
     457                                        abBuf, sizeof(abBuf));
    452458        if (RT_FAILURE(rc))
    453459        {
     
    500506
    501507
    502 static int dbgDiggerDarwinAddModule(PDBGDIGGERDARWIN pThis, PUVM pUVM, uint64_t uModAddr, const char *pszName, bool *pf64Bit)
     508static int dbgDiggerDarwinAddModule(PDBGDIGGERDARWIN pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     509                                    uint64_t uModAddr, const char *pszName, bool *pf64Bit)
    503510{
    504511    RT_NOREF1(pThis);
     
    512519    /* Read the first page of the image. */
    513520    DBGFADDRESS ModAddr;
    514     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr), uBuf.ab, X86_PAGE_4K_SIZE);
     521    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     522                                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr), uBuf.ab, X86_PAGE_4K_SIZE);
    515523    if (RT_FAILURE(rc))
    516524        return rc;
     
    539547    if (uBuf.Hdr32.sizeofcmds + (f64Bit ? sizeof(mach_header_64_t) : sizeof(mach_header_32_t)) > X86_PAGE_4K_SIZE)
    540548    {
    541         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr + X86_PAGE_4K_SIZE),
    542                            &uBuf.ab[X86_PAGE_4K_SIZE], X86_PAGE_4K_SIZE);
     549        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr + X86_PAGE_4K_SIZE),
     550                                    &uBuf.ab[X86_PAGE_4K_SIZE], X86_PAGE_4K_SIZE);
    543551        if (RT_FAILURE(rc))
    544552            return rc;
     
    578586                    return VERR_INVALID_NAME;
    579587                if (   !strcmp(uLCmd.pSeg32->segname, "__LINKEDIT")
    580                     && !(fHasLinkEdit = dbgDiggerDarwinIsSegmentPresent(pUVM, uLCmd.pSeg32->vmaddr, uLCmd.pSeg32->vmsize,
     588                    && !(fHasLinkEdit = dbgDiggerDarwinIsSegmentPresent(pUVM, pVMM, uLCmd.pSeg32->vmaddr, uLCmd.pSeg32->vmsize,
    581589                                                                        uModAddr, uModAddr + _64M)))
    582590                    break; /* This usually is discarded or not loaded at all. */
     
    599607                    return VERR_INVALID_NAME;
    600608                if (   !strcmp(uLCmd.pSeg64->segname, "__LINKEDIT")
    601                     && !(fHasLinkEdit = dbgDiggerDarwinIsSegmentPresent(pUVM, uLCmd.pSeg64->vmaddr, uLCmd.pSeg64->vmsize,
     609                    && !(fHasLinkEdit = dbgDiggerDarwinIsSegmentPresent(pUVM, pVMM, uLCmd.pSeg64->vmaddr, uLCmd.pSeg64->vmsize,
    602610                                                                        uModAddr, uModAddr + _128M)))
    603611                    break; /* This usually is discarded or not loaded at all. */
     
    658666    RTDBGMOD hMod;
    659667    rc = RTDbgModCreateFromMachOImage(&hMod, pszName, NULL, f64Bit ? RTLDRARCH_AMD64 : RTLDRARCH_X86_32, NULL /*phLdrModIn*/,
    660                                       0 /*cbImage*/, cSegs, aSegs, &Uuid, DBGFR3AsGetConfig(pUVM),
     668                                      0 /*cbImage*/, cSegs, aSegs, &Uuid, pVMM->pfnDBGFR3AsGetConfig(pUVM),
    661669                                      RTDBGMOD_F_NOT_DEFERRED | (fHasLinkEdit ? RTDBGMOD_F_MACHO_LOAD_LINKEDIT : 0));
    662670
     
    670678        DBGFADDRESS DbgfAddr;
    671679        RTERRINFOSTATIC ErrInfo;
    672         rc = DBGFR3ModInMem(pUVM, DBGFR3AddrFromFlat(pUVM, &DbgfAddr, uModAddr),
    673                             DBGFMODINMEM_F_NO_CONTAINER_FALLBACK,
    674                             pszName, NULL /*pszFilename*/, f64Bit ? RTLDRARCH_AMD64 : RTLDRARCH_X86_32, 0 /*cbImage */,
    675                             &hMod, RTErrInfoInitStatic(&ErrInfo));
     680        rc = pVMM->pfnDBGFR3ModInMem(pUVM, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &DbgfAddr, uModAddr),
     681                                     DBGFMODINMEM_F_NO_CONTAINER_FALLBACK,
     682                                     pszName, NULL /*pszFilename*/, f64Bit ? RTLDRARCH_AMD64 : RTLDRARCH_X86_32, 0 /*cbImage */,
     683                                     &hMod, RTErrInfoInitStatic(&ErrInfo));
    676684        if (RT_FAILURE(rc))
    677685            LogRel(("OSXDig: Failed to do an in-memory-opening of '%s' at %#RX64: %Rrc%s%s\n", pszName, uModAddr, rc,
     
    718726     * Link the module.
    719727     */
    720     RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     728    RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    721729    if (hAs != NIL_RTDBGAS)
    722730    {
     
    788796 * @copydoc DBGFOSREG::pfnInit
    789797 */
    790 static DECLCALLBACK(int)  dbgDiggerDarwinInit(PUVM pUVM, void *pvData)
     798static DECLCALLBACK(int)  dbgDiggerDarwinInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    791799{
    792800    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
     
    797805     */
    798806    bool f64Bit;
    799     int rc = dbgDiggerDarwinAddModule(pThis, pUVM, pThis->AddrKernel.FlatPtr, "mach_kernel", &f64Bit);
     807    int rc = dbgDiggerDarwinAddModule(pThis, pUVM, pVMM, pThis->AddrKernel.FlatPtr, "mach_kernel", &f64Bit);
    800808    if (RT_SUCCESS(rc))
    801809    {
     
    809817         */
    810818        RTDBGSYMBOL SymInfo;
    811         rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "mach_kernel!kmod", &SymInfo, NULL);
     819        rc = pVMM->pfnDBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "mach_kernel!kmod", &SymInfo, NULL);
    812820        if (RT_FAILURE(rc))
    813             rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "mach_kernel!_kmod", &SymInfo, NULL);
     821            rc = pVMM->pfnDBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "mach_kernel!_kmod", &SymInfo, NULL);
    814822        if (RT_SUCCESS(rc))
    815823        {
    816824            DBGFADDRESS AddrModInfo;
    817             DBGFR3AddrFromFlat(pUVM, &AddrModInfo, SymInfo.Value);
     825            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrModInfo, SymInfo.Value);
    818826
    819827            /* Read the variable. */
    820828            RTUINT64U uKmodValue = { 0 };
    821829            if (f64Bit)
    822                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrModInfo, &uKmodValue.u, sizeof(uKmodValue.u));
     830                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrModInfo, &uKmodValue.u, sizeof(uKmodValue.u));
    823831            else
    824                 rc = DBGFR3MemRead (pUVM, 0 /*idCpu*/, &AddrModInfo, &uKmodValue.s.Lo, sizeof(uKmodValue.s.Lo));
     832                rc = pVMM->pfnDBGFR3MemRead (pUVM, 0 /*idCpu*/, &AddrModInfo, &uKmodValue.s.Lo, sizeof(uKmodValue.s.Lo));
    825833            if (RT_SUCCESS(rc))
    826834            {
    827                 DBGFR3AddrFromFlat(pUVM, &AddrModInfo, uKmodValue.u);
     835                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrModInfo, uKmodValue.u);
    828836
    829837                /* Walk the list of modules. */
     
    857865                    } uMod;
    858866                    RT_ZERO(uMod);
    859                     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrModInfo, &uMod,
    860                                        f64Bit ? sizeof(uMod.Info64) : sizeof(uMod.Info32));
     867                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrModInfo, &uMod,
     868                                                f64Bit ? sizeof(uMod.Info64) : sizeof(uMod.Info32));
    861869                    if (RT_FAILURE(rc))
    862870                    {
     
    941949                    LogRel(("OSXDig: kmod_info @%RGv: '%s' ver '%s', image @%#llx LB %#llx cbHdr=%#llx\n", AddrModInfo.FlatPtr,
    942950                            pszName, pszVersion, uImageAddr, cbImage, cbHdr));
    943                     rc = dbgDiggerDarwinAddModule(pThis, pUVM, uImageAddr, pszName, NULL);
     951                    rc = dbgDiggerDarwinAddModule(pThis, pUVM, pVMM, uImageAddr, pszName, NULL);
    944952
    945953
     
    947955                     * Advance to the next kmod_info entry.
    948956                     */
    949                     DBGFR3AddrFromFlat(pUVM, &AddrModInfo, f64Bit ? uMod.Info64.next : uMod.Info32.next);
     957                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrModInfo, f64Bit ? uMod.Info64.next : uMod.Info32.next);
    950958                }
    951959            }
     
    967975 * @copydoc DBGFOSREG::pfnProbe
    968976 */
    969 static DECLCALLBACK(bool)  dbgDiggerDarwinProbe(PUVM pUVM, void *pvData)
     977static DECLCALLBACK(bool)  dbgDiggerDarwinProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    970978{
    971979    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
     
    986994        { UINT64_C(0x00001000), UINT64_C(0x0ffff000), }
    987995    };
    988     for (unsigned iRange = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/) != CPUMMODE_LONG;
     996    for (unsigned iRange = pVMM->pfnDBGFR3CpuGetMode(pUVM, 0 /*idCpu*/) != CPUMMODE_LONG;
    989997          iRange < RT_ELEMENTS(s_aRanges);
    990998          iRange++)
    991999    {
    9921000        DBGFADDRESS     KernelAddr;
    993         for (DBGFR3AddrFromFlat(pUVM, &KernelAddr, s_aRanges[iRange].uStart);
     1001        for (pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, s_aRanges[iRange].uStart);
    9941002             KernelAddr.FlatPtr < s_aRanges[iRange].uEnd;
    9951003             KernelAddr.FlatPtr += X86_PAGE_4K_SIZE)
     
    10011009            };
    10021010
    1003             int rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, s_aRanges[iRange].uEnd - KernelAddr.FlatPtr,
    1004                                    1, s_abNeedle, sizeof(s_abNeedle), &KernelAddr);
     1011            int rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, s_aRanges[iRange].uEnd - KernelAddr.FlatPtr,
     1012                                            1, s_abNeedle, sizeof(s_abNeedle), &KernelAddr);
    10051013            if (RT_FAILURE(rc))
    10061014                break;
    1007             DBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & X86_PAGE_4K_OFFSET_MASK);
     1015            pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & X86_PAGE_4K_OFFSET_MASK);
    10081016
    10091017            /*
     
    10161024                mach_header_32_t    Hdr32;
    10171025            } uBuf;
    1018             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, uBuf.ab, X86_PAGE_4K_SIZE);
     1026            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, uBuf.ab, X86_PAGE_4K_SIZE);
    10191027            if (RT_FAILURE(rc))
    10201028                continue;
     
    10471055             * Finally, find the kernel version string.
    10481056             */
    1049             rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, 32*_1M, 1, RT_STR_TUPLE("Darwin Kernel Version"),
    1050                                &pThis->AddrKernelVersion);
     1057            rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, 32*_1M, 1, RT_STR_TUPLE("Darwin Kernel Version"),
     1058                                        &pThis->AddrKernelVersion);
    10511059            if (RT_FAILURE(rc))
    1052                 DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelVersion, 0);
     1060                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelVersion, 0);
    10531061            return true;
    10541062        }
     
    10611069 * @copydoc DBGFOSREG::pfnDestruct
    10621070 */
    1063 static DECLCALLBACK(void)  dbgDiggerDarwinDestruct(PUVM pUVM, void *pvData)
    1064 {
    1065     RT_NOREF2(pUVM, pvData);
    1066 
     1071static DECLCALLBACK(void)  dbgDiggerDarwinDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1072{
     1073    RT_NOREF(pUVM, pVMM, pvData);
    10671074}
    10681075
     
    10711078 * @copydoc DBGFOSREG::pfnConstruct
    10721079 */
    1073 static DECLCALLBACK(int)  dbgDiggerDarwinConstruct(PUVM pUVM, void *pvData)
    1074 {
    1075     RT_NOREF1(pUVM);
     1080static DECLCALLBACK(int)  dbgDiggerDarwinConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1081{
     1082    RT_NOREF(pUVM, pVMM);
    10761083    PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData;
    10771084
  • trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp

    r93115 r93470  
    2222#define LOG_GROUP LOG_GROUP_DBGC
    2323#include <VBox/dbg.h>
    24 #include <VBox/vmm/dbgf.h>
     24#include <VBox/vmm/vmmr3vtable.h>
    2525#include "DBGPlugIns.h"
    2626#include <VBox/version.h>
     
    2828
    2929
    30 DECLEXPORT(int) DbgPlugInEntry(DBGFPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg)
     30DECLEXPORT(int) DbgPlugInEntry(DBGFPLUGINOP enmOperation, PUVM pUVM, PCVMMR3VTABLE pVMM, uintptr_t uArg)
    3131{
    3232    static PCDBGFOSREG s_aPlugIns[] =
     
    4949            for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
    5050            {
    51                 int rc = DBGFR3OSRegister(pUVM, s_aPlugIns[i]);
     51                int rc = pVMM->pfnDBGFR3OSRegister(pUVM, s_aPlugIns[i]);
    5252                if (RT_FAILURE(rc))
    5353                {
    5454                    AssertRC(rc);
    5555                    while (i-- > 0)
    56                         DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
     56                        pVMM->pfnDBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
    5757                    return rc;
    5858                }
     
    6565            for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
    6666            {
    67                 int rc = DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
     67                int rc = pVMM->pfnDBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
    6868                AssertRC(rc);
    6969            }
  • trunk/src/VBox/Debugger/DBGPlugInFreeBsd.cpp

    r93115 r93470  
    2323#include "DBGPlugIns.h"
    2424#include "DBGPlugInCommonELF.h"
    25 #include <VBox/vmm/dbgf.h>
     25#include <VBox/vmm/vmmr3vtable.h>
    2626#include <iprt/asm.h>
    2727#include <iprt/ctype.h>
     
    195195*   Internal Functions                                                                                                           *
    196196*********************************************************************************************************************************/
    197 static DECLCALLBACK(int)  dbgDiggerFreeBsdInit(PUVM pUVM, void *pvData);
     197static DECLCALLBACK(int)  dbgDiggerFreeBsdInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData);
    198198
    199199
     
    226226 * @param   cbDynstr        Size of the .dynstr section.
    227227 */
    228 static int dbgDiggerFreeBsdLoadSymbols(PDBGDIGGERFBSD pThis, PUVM pUVM, const char *pszName, RTGCUINTPTR uKernelStart,
    229                                        size_t cbKernel, PDBGFADDRESS pAddrDynsym, uint32_t cSymbols, PDBGFADDRESS pAddrDynstr,
    230                                        size_t cbDynstr)
     228static int dbgDiggerFreeBsdLoadSymbols(PDBGDIGGERFBSD pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszName,
     229                                       RTGCUINTPTR uKernelStart, size_t cbKernel, PDBGFADDRESS pAddrDynsym, uint32_t cSymbols,
     230                                       PDBGFADDRESS pAddrDynstr, size_t cbDynstr)
    231231{
    232232    LogFlowFunc(("pThis=%#p pszName=%s uKernelStart=%RGv cbKernel=%zu pAddrDynsym=%#p{%RGv} cSymbols=%u pAddrDynstr=%#p{%RGv} cbDynstr=%zu\n",
     
    234234
    235235    char *pbDynstr = (char *)RTMemAllocZ(cbDynstr + 1); /* Extra terminator. */
    236     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrDynstr, pbDynstr, cbDynstr);
     236    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrDynstr, pbDynstr, cbDynstr);
    237237    if (RT_SUCCESS(rc))
    238238    {
    239239        uint32_t cbDynsymEnt = pThis->f64Bit ? sizeof(Elf64_Sym) : sizeof(Elf32_Sym);
    240240        uint8_t *pbDynsym = (uint8_t *)RTMemAllocZ(cSymbols * cbDynsymEnt);
    241         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrDynsym, pbDynsym, cSymbols * cbDynsymEnt);
     241        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrDynsym, pbDynsym, cSymbols * cbDynsymEnt);
    242242        if (RT_SUCCESS(rc))
    243243        {
     
    294294                if (RT_SUCCESS(rc))
    295295                {
    296                     RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     296                    RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    297297                    if (hAs != NIL_RTDBGAS)
    298298                        rc = RTDbgAsModuleLink(hAs, hMod, uKernelStart, RTDBGASLINK_FLAGS_REPLACE);
     
    327327 * @param   pThis           The instance data.
    328328 * @param   pUVM            The user mode VM handle.
     329 * @param   pVMM            The VMM function table.
    329330 * @param   pszName         The image name.
    330331 */
    331 static void dbgDiggerFreeBsdProcessKernelImage(PDBGDIGGERFBSD pThis, PUVM pUVM, const char *pszName)
     332static void dbgDiggerFreeBsdProcessKernelImage(PDBGDIGGERFBSD pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszName)
    332333{
    333334    /*
     
    378379        size_t cbToRead = RT_MIN(sizeof(achBuf), AddrCur.FlatPtr - AddrInterpEnd.FlatPtr);
    379380
    380         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrSub(&AddrCur, cbToRead), &achBuf[0], cbToRead);
     381        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrSub(&AddrCur, cbToRead), &achBuf[0], cbToRead);
    381382        if (RT_FAILURE(rc))
    382383            break;
     
    403404                    {
    404405                        /* Two consecutive terminator symbols mean end of .dynstr section. */
    405                         DBGFR3AddrAdd(&AddrCur, i);
     406                        pVMM->pfnDBGFR3AddrAdd(&AddrCur, i);
    406407                        DBGFADDRESS AddrDynstrStart = AddrCur;
    407408                        DBGFADDRESS AddrDynsymStart = AddrCur;
    408                         DBGFR3AddrSub(&AddrDynsymStart, cSymbols * (pThis->f64Bit ? sizeof(Elf64_Sym) : sizeof(Elf64_Sym)));
     409                        pVMM->pfnDBGFR3AddrSub(&AddrDynsymStart, cSymbols * (pThis->f64Bit ? sizeof(Elf64_Sym) : sizeof(Elf64_Sym)));
    409410                        LogFlowFunc(("Found all required section start addresses (.dynsym=%RGv cSymbols=%u, .dynstr=%RGv cb=%u)\n",
    410411                                     AddrDynsymStart.FlatPtr, cSymbols, AddrDynstrStart.FlatPtr,
    411412                                     pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr));
    412                         dbgDiggerFreeBsdLoadSymbols(pThis, pUVM, pszName, uKernelStart, cbKernel, &AddrDynsymStart, cSymbols, &AddrDynstrStart,
     413                        dbgDiggerFreeBsdLoadSymbols(pThis, pUVM, pVMM, pszName, uKernelStart, cbKernel,
     414                                                    &AddrDynsymStart, cSymbols, &AddrDynstrStart,
    413415                                                    pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr);
    414416                        return;
     
    431433                        {
    432434                            /* Indicates the end of the .dynstr section. */
    433                             DBGFR3AddrAdd(&AddrCur, i);
     435                            pVMM->pfnDBGFR3AddrAdd(&AddrCur, i);
    434436                            DBGFADDRESS AddrDynstrStart = AddrCur;
    435437                            DBGFADDRESS AddrDynsymStart = AddrCur;
    436                             DBGFR3AddrSub(&AddrDynsymStart, cSymbols * (pThis->f64Bit ? sizeof(Elf64_Sym) : sizeof(Elf32_Sym)));
     438                            pVMM->pfnDBGFR3AddrSub(&AddrDynsymStart, cSymbols * (pThis->f64Bit ? sizeof(Elf64_Sym) : sizeof(Elf32_Sym)));
    437439                            LogFlowFunc(("Found all required section start addresses (.dynsym=%RGv cSymbols=%u, .dynstr=%RGv cb=%u)\n",
    438440                                         AddrDynsymStart.FlatPtr, cSymbols, AddrDynstrStart.FlatPtr,
    439441                                         pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr));
    440                             dbgDiggerFreeBsdLoadSymbols(pThis, pUVM, pszName, uKernelStart, cbKernel, &AddrDynsymStart, cSymbols, &AddrDynstrStart,
     442                            dbgDiggerFreeBsdLoadSymbols(pThis, pUVM, pVMM, pszName, uKernelStart, cbKernel,
     443                                                        &AddrDynsymStart, cSymbols, &AddrDynstrStart,
    441444                                                        pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr);
    442445                            return;
     
    455458    /* Calculate the start of the .hash section. */
    456459    DBGFADDRESS AddrHashStart = pThis->AddrKernelInterp;
    457     DBGFR3AddrAdd(&AddrHashStart, sizeof(g_abNeedleInterp));
     460    pVMM->pfnDBGFR3AddrAdd(&AddrHashStart, sizeof(g_abNeedleInterp));
    458461    AddrHashStart.FlatPtr = RT_ALIGN_GCPT(AddrHashStart.FlatPtr, pThis->f64Bit ? 8 : 4, RTGCUINTPTR);
    459462    uint32_t au32Counters[2];
    460     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrHashStart, &au32Counters[0], sizeof(au32Counters));
     463    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrHashStart, &au32Counters[0], sizeof(au32Counters));
    461464    if (RT_SUCCESS(rc))
    462465    {
     
    469472            RTGCUINTPTR uKernelStart = pThis->AddrKernelElfStart.FlatPtr;
    470473
    471             DBGFR3AddrAdd(&AddrDynsymStart, cbHash);
     474            pVMM->pfnDBGFR3AddrAdd(&AddrDynsymStart, cbHash);
    472475            AddrDynsymStart.FlatPtr = RT_ALIGN_GCPT(AddrDynsymStart.FlatPtr, pThis->f64Bit ? 8 : 4, RTGCUINTPTR);
    473476
     
    479482                size_t cbToRead = RT_MIN(sizeof(abBuf), pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr);
    480483
    481                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrDynstrStart, &abBuf[0], cbToRead);
     484                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrDynstrStart, &abBuf[0], cbToRead);
    482485                if (RT_FAILURE(rc))
    483486                    break;
     
    522525                        if (!cbLeft)
    523526                        {
    524                             DBGFR3AddrAdd(&AddrDynstrStart, i * cbDynSymEnt);
     527                            pVMM->pfnDBGFR3AddrAdd(&AddrDynstrStart, i * cbDynSymEnt);
    525528                            LogFlowFunc(("Found all required section start addresses (.dynsym=%RGv cSymbols=%u, .dynstr=%RGv cb=%u)\n",
    526529                                         AddrDynsymStart.FlatPtr, cSymbols, AddrDynstrStart.FlatPtr,
    527530                                         pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr));
    528                             dbgDiggerFreeBsdLoadSymbols(pThis, pUVM, pszName, uKernelStart, cbKernel, &AddrDynsymStart, cSymbols, &AddrDynstrStart,
     531                            dbgDiggerFreeBsdLoadSymbols(pThis, pUVM, pVMM, pszName, uKernelStart, cbKernel,
     532                                                        &AddrDynsymStart, cSymbols, &AddrDynstrStart,
    529533                                                        pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr);
    530534                            return;
     
    546550
    547551                /* Don't account incomplete entries. */
    548                 DBGFR3AddrAdd(&AddrDynstrStart, (cbToRead / cbDynSymEnt) * cbDynSymEnt);
     552                pVMM->pfnDBGFR3AddrAdd(&AddrDynstrStart, (cbToRead / cbDynSymEnt) * cbDynSymEnt);
    549553            }
    550554        }
     
    560564 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog}
    561565 */
    562 static DECLCALLBACK(int) dbgDiggerFreeBsdIDmsg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, uint32_t fFlags, uint32_t cMessages,
    563                                                               char *pszBuf, size_t cbBuf, size_t *pcbActual)
    564 {
    565     RT_NOREF1(fFlags);
     566static DECLCALLBACK(int) dbgDiggerFreeBsdIDmsg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, uint32_t fFlags,
     567                                                              uint32_t cMessages, char *pszBuf, size_t cbBuf, size_t *pcbActual)
     568{
    566569    PDBGDIGGERFBSD pData = RT_FROM_MEMBER(pThis, DBGDIGGERFBSD, IDmesg);
     570    RT_NOREF(fFlags);
    567571
    568572    if (cMessages < 1)
     
    571575    /* Resolve the message buffer address from the msgbufp symbol. */
    572576    RTDBGSYMBOL SymInfo;
    573     int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "kernel!msgbufp", &SymInfo, NULL);
     577    int rc = pVMM->pfnDBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "kernel!msgbufp", &SymInfo, NULL);
    574578    if (RT_SUCCESS(rc))
    575579    {
     
    578582        /* Read the message buffer pointer. */
    579583        RTGCPTR     GCPtrMsgBufP = 0;
    580         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &AddrMsgBuf, SymInfo.Value),
    581                            &GCPtrMsgBufP, pData->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t));
     584        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrMsgBuf, SymInfo.Value),
     585                                    &GCPtrMsgBufP, pData->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t));
    582586        if (RT_FAILURE(rc))
    583587        {
     
    593597        /* Read the structure. */
    594598        FBSDMSGBUF MsgBuf;
    595         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &AddrMsgBuf, GCPtrMsgBufP),
    596                            &MsgBuf, sizeof(MsgBuf));
     599        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrMsgBuf, GCPtrMsgBufP),
     600                                    &MsgBuf, sizeof(MsgBuf));
    597601        if (RT_SUCCESS(rc))
    598602        {
     
    627631                return VERR_INVALID_STATE;
    628632            }
    629             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &AddrMsgBuf, AddrBuf), pchMsgBuf, cbMsgBuf);
     633            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrMsgBuf, AddrBuf),
     634                                        pchMsgBuf, cbMsgBuf);
    630635            if (RT_SUCCESS(rc))
    631636            {
     
    704709 * @copydoc DBGFOSREG::pfnStackUnwindAssist
    705710 */
    706 static DECLCALLBACK(int) dbgDiggerFreeBsdStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,
    707                                                            PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,
    708                                                            uint64_t *puScratch)
    709 {
    710     RT_NOREF(pUVM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
     711static DECLCALLBACK(int) dbgDiggerFreeBsdStackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu,
     712                                                           PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState,
     713                                                           PCCPUMCTX pInitialCtx, RTDBGAS hAs, uint64_t *puScratch)
     714{
     715    RT_NOREF(pUVM, pVMM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
    711716    return VINF_SUCCESS;
    712717}
     
    716721 * @copydoc DBGFOSREG::pfnQueryInterface
    717722 */
    718 static DECLCALLBACK(void *) dbgDiggerFreeBsdQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    719 {
    720     RT_NOREF1(pUVM);
     723static DECLCALLBACK(void *) dbgDiggerFreeBsdQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf)
     724{
    721725    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
     726    RT_NOREF(pUVM, pVMM);
     727
    722728    switch (enmIf)
    723729    {
     
    734740 * @copydoc DBGFOSREG::pfnQueryVersion
    735741 */
    736 static DECLCALLBACK(int)  dbgDiggerFreeBsdQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
     742static DECLCALLBACK(int)  dbgDiggerFreeBsdQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData,
     743                                                       char *pszVersion, size_t cchVersion)
    737744{
    738745    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
     
    740747
    741748    RTDBGSYMBOL SymInfo;
    742     int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "kernel!version", &SymInfo, NULL);
     749    int rc = pVMM->pfnDBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "kernel!version", &SymInfo, NULL);
    743750    if (RT_SUCCESS(rc))
    744751    {
    745752        DBGFADDRESS AddrVersion;
    746         DBGFR3AddrFromFlat(pUVM, &AddrVersion, SymInfo.Value);
    747 
    748         rc = DBGFR3MemReadString(pUVM, 0, &AddrVersion, pszVersion, cchVersion);
     753        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrVersion, SymInfo.Value);
     754
     755        rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &AddrVersion, pszVersion, cchVersion);
    749756        if (RT_SUCCESS(rc))
    750757        {
     
    768775 * @copydoc DBGFOSREG::pfnTerm
    769776 */
    770 static DECLCALLBACK(void)  dbgDiggerFreeBsdTerm(PUVM pUVM, void *pvData)
    771 {
    772     RT_NOREF1(pUVM);
     777static DECLCALLBACK(void)  dbgDiggerFreeBsdTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     778{
    773779    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
    774780    Assert(pThis->fValid);
    775 
    776     RT_NOREF1(pUVM);
     781    RT_NOREF(pUVM, pVMM);
    777782
    778783    pThis->fValid = false;
     
    783788 * @copydoc DBGFOSREG::pfnRefresh
    784789 */
    785 static DECLCALLBACK(int)  dbgDiggerFreeBsdRefresh(PUVM pUVM, void *pvData)
     790static DECLCALLBACK(int)  dbgDiggerFreeBsdRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    786791{
    787792    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
     
    789794    Assert(pThis->fValid);
    790795
    791     dbgDiggerFreeBsdTerm(pUVM, pvData);
    792     return dbgDiggerFreeBsdInit(pUVM, pvData);
     796    dbgDiggerFreeBsdTerm(pUVM, pVMM, pvData);
     797    return dbgDiggerFreeBsdInit(pUVM, pVMM, pvData);
    793798}
    794799
     
    797802 * @copydoc DBGFOSREG::pfnInit
    798803 */
    799 static DECLCALLBACK(int)  dbgDiggerFreeBsdInit(PUVM pUVM, void *pvData)
     804static DECLCALLBACK(int)  dbgDiggerFreeBsdInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    800805{
    801806    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
     
    804809    RT_NOREF1(pUVM);
    805810
    806     dbgDiggerFreeBsdProcessKernelImage(pThis, pUVM, "kernel");
     811    dbgDiggerFreeBsdProcessKernelImage(pThis, pUVM, pVMM, "kernel");
    807812    pThis->fValid = true;
    808813    return VINF_SUCCESS;
     
    813818 * @copydoc DBGFOSREG::pfnProbe
    814819 */
    815 static DECLCALLBACK(bool)  dbgDiggerFreeBsdProbe(PUVM pUVM, void *pvData)
     820static DECLCALLBACK(bool)  dbgDiggerFreeBsdProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    816821{
    817822    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
     
    827832        static const uint8_t s_abNeedle[] = ELFMAG;
    828833        DBGFADDRESS KernelAddr;
    829         DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64FreeBsdKernelAddresses[i]);
     834        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64FreeBsdKernelAddresses[i]);
    830835        DBGFADDRESS HitAddr;
    831836        uint32_t    cbLeft  = FBSD_MAX_KERNEL_SIZE;
     
    833838        while (cbLeft > X86_PAGE_4K_SIZE)
    834839        {
    835             int rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, cbLeft, 1,
    836                                    s_abNeedle, sizeof(s_abNeedle) - 1, &HitAddr);
     840            int rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, cbLeft, 1,
     841                                            s_abNeedle, sizeof(s_abNeedle) - 1, &HitAddr);
    837842            if (RT_FAILURE(rc))
    838843                break;
     
    843848             */
    844849            DBGFADDRESS HitAddrInterp;
    845             rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, FBSD_MAX_INTERP_OFFSET, 1,
    846                                g_abNeedleInterp, sizeof(g_abNeedleInterp), &HitAddrInterp);
     850            rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, FBSD_MAX_INTERP_OFFSET, 1,
     851                                        g_abNeedleInterp, sizeof(g_abNeedleInterp), &HitAddrInterp);
    847852            if (RT_SUCCESS(rc))
    848853            {
     
    858863                AssertCompileMembersSameSizeAndOffset(Elf64_Ehdr, e_version, Elf32_Ehdr, e_version);
    859864
    860                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &HitAddr, &ElfHdr.ab[0], X86_PAGE_4K_SIZE);
     865                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &HitAddr, &ElfHdr.ab[0], X86_PAGE_4K_SIZE);
    861866                if (RT_SUCCESS(rc))
    862867                {
     
    875880                        pThis->AddrKernelElfStart = HitAddr;
    876881                        pThis->AddrKernelInterp = HitAddrInterp;
    877                         DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelText, FBSD_UNION(pThis, &ElfHdr, e_entry));
     882                        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelText, FBSD_UNION(pThis, &ElfHdr, e_entry));
    878883                        LogFunc(("Found %s FreeBSD kernel at %RGv (.interp section at %RGv, .text section at %RGv)\n",
    879884                                 pThis->f64Bit ? "amd64" : "i386", pThis->AddrKernelElfStart.FlatPtr,
     
    892897
    893898            cbLeft -= cbDistance;
    894             DBGFR3AddrAdd(&KernelAddr, cbDistance);
     899            pVMM->pfnDBGFR3AddrAdd(&KernelAddr, cbDistance);
    895900        }
    896901    }
     
    902907 * @copydoc DBGFOSREG::pfnDestruct
    903908 */
    904 static DECLCALLBACK(void)  dbgDiggerFreeBsdDestruct(PUVM pUVM, void *pvData)
    905 {
    906     RT_NOREF2(pUVM, pvData);
     909static DECLCALLBACK(void)  dbgDiggerFreeBsdDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     910{
     911    RT_NOREF(pUVM, pVMM, pvData);
    907912}
    908913
     
    911916 * @copydoc DBGFOSREG::pfnConstruct
    912917 */
    913 static DECLCALLBACK(int)  dbgDiggerFreeBsdConstruct(PUVM pUVM, void *pvData)
    914 {
    915     RT_NOREF1(pUVM);
     918static DECLCALLBACK(int)  dbgDiggerFreeBsdConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     919{
    916920    PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData;
     921    RT_NOREF(pUVM, pVMM);
    917922
    918923    pThis->fValid = false;
  • trunk/src/VBox/Debugger/DBGPlugInLinux.cpp

    r93115 r93470  
    2323#include "DBGPlugIns.h"
    2424#include "DBGPlugInCommonELF.h"
    25 #include <VBox/vmm/dbgf.h>
     25#include <VBox/vmm/vmmr3vtable.h>
    2626#include <VBox/dis.h>
    2727#include <iprt/ctype.h>
     
    220220*   Internal Functions                                                                                                           *
    221221*********************************************************************************************************************************/
    222 static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, void *pvData);
     222static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData);
    223223
    224224
     
    246246 * @param   pThis               The Linux digger data.
    247247 * @param   pUVM                The VM handle.
     248 * @param   pVMM                The VMM function table.
    248249 * @param   pGCPtrLogBuf        Where to store the start of the kernel log buffer on success.
    249250 * @param   pcbLogBuf           Where to store the size of the kernel log buffer on success.
    250251 */
    251 static int dbgDiggerLinuxKrnlLogBufFindByNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf)
     252static int dbgDiggerLinuxKrnlLogBufFindByNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     253                                                RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf)
    252254{
    253255    int rc = VINF_SUCCESS;
     
    256258    DBGFADDRESS AddrScan;
    257259    DBGFADDRESS AddrHit;
    258     DBGFR3AddrFromFlat(pUVM, &AddrScan, pThis->f64Bit ? LNX64_KERNEL_ADDRESS_START : LNX32_KERNEL_ADDRESS_START);
    259 
    260     rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &AddrScan, ~(RTGCUINTPTR)0, 1 /*uAlign*/,
    261                        g_abKrnlLogNeedle, sizeof(g_abKrnlLogNeedle) - 1, &AddrHit);
     260    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrScan, pThis->f64Bit ? LNX64_KERNEL_ADDRESS_START : LNX32_KERNEL_ADDRESS_START);
     261
     262    rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &AddrScan, ~(RTGCUINTPTR)0, 1 /*uAlign*/,
     263                                g_abKrnlLogNeedle, sizeof(g_abKrnlLogNeedle) - 1, &AddrHit);
    262264    if (RT_SUCCESS(rc))
    263265    {
     
    266268        DBGFADDRESS AddrCur;
    267269
    268         DBGFR3AddrSub(&AddrHit, sizeof(LNXPRINTKHDR));
     270        pVMM->pfnDBGFR3AddrSub(&AddrHit, sizeof(LNXPRINTKHDR));
    269271        AddrCur = AddrHit;
    270272
     
    276278
    277279            LNXPRINTKHDR Hdr;
    278             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrCur, &Hdr, sizeof(Hdr));
     280            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrCur, &Hdr, sizeof(Hdr));
    279281            if (RT_SUCCESS(rc))
    280282            {
     
    294296
    295297                cbLogBuf += Hdr.cbTotal;
    296                 DBGFR3AddrAdd(&AddrCur, Hdr.cbTotal);
     298                pVMM->pfnDBGFR3AddrAdd(&AddrCur, Hdr.cbTotal);
    297299            }
    298300
     
    360362 * @param   pThis               The Linux digger data.
    361363 * @param   pUVM                The VM handle.
     364 * @param   pVMM                The VMM function table.
    362365 * @param   hMod                The module to use.
    363366 * @param   pszSymbol           The symbol of the getter.
     
    365368 * @param   cbVal               Size of the value in bytes.
    366369 */
    367 static int dbgDiggerLinuxDisassembleSimpleGetter(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,
     370static int dbgDiggerLinuxDisassembleSimpleGetter(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod,
    368371                                                 const char *pszSymbol, void *pvVal, uint32_t cbVal)
    369372{
     
    391394            DBGFADDRESS Addr;
    392395            RTGCPTR GCPtrCur = (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr + offInstr;
    393             DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur);
     396            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur);
    394397
    395398            /* Prefetch the instruction. */
    396399            uint8_t abInstr[32];
    397             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &abInstr[0], sizeof(abInstr));
     400            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &abInstr[0], sizeof(abInstr));
    398401            if (RT_SUCCESS(rc))
    399402            {
     
    444447
    445448                                    DBGFADDRESS AddrVal;
    446                                     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/,
    447                                                        DBGFR3AddrFromFlat(pUVM, &AddrVal, GCPtrVal),
    448                                                        pvVal, cbVal);
     449                                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     450                                                                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrVal, GCPtrVal),
     451                                                                pvVal, cbVal);
    449452                                }
    450453                            }
     
    473476 * @param   pThis               The Linux digger data.
    474477 * @param   pUVM                The VM handle.
     478 * @param   pVMM                The VMM function table.
    475479 * @param   hMod                The module to use.
    476480 * @param   pGCPtrLogBuf        Where to store the log buffer pointer on success.
    477481 * @param   pcbLogBuf           Where to store the size of the log buffer on success.
    478482 */
    479 static int dbgDiggerLinuxQueryAsciiLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,
     483static int dbgDiggerLinuxQueryAsciiLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod,
    480484                                                 RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf)
    481485{
     
    522526            DBGFADDRESS Addr;
    523527            RTGCPTR GCPtrCur = (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr + offInstr;
    524             DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur);
     528            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur);
    525529
    526530            /* Prefetch the instruction. */
    527531            uint8_t abInstr[32];
    528             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &abInstr[0], sizeof(abInstr));
     532            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &abInstr[0], sizeof(abInstr));
    529533            if (RT_SUCCESS(rc))
    530534            {
     
    574578                                    union { uint8_t abVal[8]; uint32_t u32Val; uint64_t u64Val; } Val;
    575579
    576                                     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/,
    577                                                        DBGFR3AddrFromFlat(pUVM, &AddrVal, aAddresses[i].GCPtrOrigSrc),
    578                                                        &Val.abVal[0], aAddresses[i].cb);
     580                                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     581                                                                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrVal,
     582                                                                                            aAddresses[i].GCPtrOrigSrc),
     583                                                                &Val.abVal[0], aAddresses[i].cb);
    579584                                    if (RT_SUCCESS(rc))
    580585                                    {
     
    697702 * @param   pThis               The Linux digger data.
    698703 * @param   pUVM                The VM handle.
     704 * @param   pVMM                The VMM function table.
    699705 * @param   hMod                The module to use.
    700706 * @param   pGCPtrLogBuf        Where to store the log buffer pointer on success.
    701707 * @param   pcbLogBuf           Where to store the size of the log buffer on success.
    702708 */
    703 static int dbgDiggerLinuxQueryLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,
     709static int dbgDiggerLinuxQueryLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod,
    704710                                            RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf)
    705711{
     
    715721        RT_BZERO(aSymbols[i].pvVar, aSymbols[i].cbHost);
    716722        Assert(aSymbols[i].cbHost >= aSymbols[i].cbGuest);
    717         rc = dbgDiggerLinuxDisassembleSimpleGetter(pThis, pUVM, hMod, aSymbols[i].pszSymbol,
     723        rc = dbgDiggerLinuxDisassembleSimpleGetter(pThis, pUVM, pVMM, hMod, aSymbols[i].pszSymbol,
    718724                                                   aSymbols[i].pvVar, aSymbols[i].cbGuest);
    719725    }
     
    729735 * @param   pThis               The Linux digger data.
    730736 * @param   pUVM                The user mode VM handle.
    731  */
    732 static bool dbgDiggerLinuxLogBufferIsAsciiBuffer(PDBGDIGGERLINUX pThis, PUVM pUVM)
     737 * @param   pVMM                The VMM function table.
     738 */
     739static bool dbgDiggerLinuxLogBufferIsAsciiBuffer(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM)
    733740{
    734741    char szTmp[128];
     
    736743
    737744    RT_ZERO(szTmp);
    738     int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, szTmp, sizeof(szTmp) - 1);
     745    int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, szTmp, sizeof(szTmp) - 1);
    739746    if (    RT_SUCCESS(rc)
    740747        &&  RTStrVersionCompare(pszVer, "3.4") == -1)
     
    750757 * @param   pThis       The Linux digger data.
    751758 * @param   pUVM        The VM user mdoe handle.
     759 * @param   pVMM        The VMM function table.
    752760 * @param   hMod        The debug module handle.
    753761 * @param   fFlags      Flags reserved for future use, MBZ.
     
    760768 *                      holds the necessary buffer size.  Optional.
    761769 */
    762 static int dbgDiggerLinuxLogBufferQueryAscii(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,
     770static int dbgDiggerLinuxLogBufferQueryAscii(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod,
    763771                                             uint32_t fFlags, uint32_t cMessages,
    764772                                             char *pszBuf, size_t cbBuf, size_t *pcbActual)
     
    783791            Assert(aSymbols[i].cbHost >= aSymbols[i].cbGuest);
    784792            DBGFADDRESS Addr;
    785             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/,
    786                                DBGFR3AddrFromFlat(pUVM, &Addr, (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr),
    787                                aSymbols[i].pvVar,  aSymbols[i].cbGuest);
     793            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     794                                        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr,
     795                                                                    (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr),
     796                                        aSymbols[i].pvVar,  aSymbols[i].cbGuest);
    788797            if (RT_SUCCESS(rc))
    789798                continue;
     
    804813    if (rc == VERR_NOT_FOUND)
    805814    {
    806         rc = dbgDiggerLinuxQueryAsciiLogBufferPtrs(pThis, pUVM, hMod, &GCPtrLogBuf, &cbLogBuf);
     815        rc = dbgDiggerLinuxQueryAsciiLogBufferPtrs(pThis, pUVM, pVMM, hMod, &GCPtrLogBuf, &cbLogBuf);
    807816        if (RT_FAILURE(rc))
    808817            return rc;
     
    835844    }
    836845    DBGFADDRESS Addr;
    837     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrLogBuf), pbLogBuf, cbLogBuf);
     846    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrLogBuf), pbLogBuf, cbLogBuf);
    838847    if (RT_FAILURE(rc))
    839848    {
     
    865874 * @param   pThis       The Linux digger data.
    866875 * @param   pUVM        The VM user mode handle.
     876 * @param   pVMM        The VMM function table.
    867877 * @param   GCPtrLogBuf Flat guest address of the start of the log buffer.
    868878 * @param   cbLogBuf    Power of two aligned size of the log buffer.
     
    878888 *                      holds the necessary buffer size.  Optional.
    879889 */
    880 static int dbgDiggerLinuxKrnLogBufferProcess(PDBGDIGGERLINUX pThis, PUVM pUVM, RTGCPTR GCPtrLogBuf,
     890static int dbgDiggerLinuxKrnLogBufferProcess(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTGCPTR GCPtrLogBuf,
    881891                                             uint32_t cbLogBuf, uint32_t idxFirst, uint32_t idxNext,
    882892                                             uint32_t fFlags, uint32_t cMessages, char *pszBuf, size_t cbBuf,
     
    924934    }
    925935    DBGFADDRESS Addr;
    926     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrLogBuf), pbLogBuf, cbLogBuf);
     936    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrLogBuf), pbLogBuf, cbLogBuf);
    927937    if (RT_FAILURE(rc))
    928938    {
     
    10611071 * @param   pThis       The Linux digger data.
    10621072 * @param   pUVM        The VM user mdoe handle.
     1073 * @param   pVMM        The VMM function table.
    10631074 * @param   hMod        The debug module handle.
    10641075 * @param   fFlags      Flags reserved for future use, MBZ.
     
    10711082 *                      holds the necessary buffer size.  Optional.
    10721083 */
    1073 static int dbgDiggerLinuxLogBufferQueryRecords(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,
     1084static int dbgDiggerLinuxLogBufferQueryRecords(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod,
    10741085                                               uint32_t fFlags, uint32_t cMessages,
    10751086                                               char *pszBuf, size_t cbBuf, size_t *pcbActual)
     
    10971108            Assert(aSymbols[i].cbHost >= aSymbols[i].cbGuest);
    10981109            DBGFADDRESS Addr;
    1099             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/,
    1100                                DBGFR3AddrFromFlat(pUVM, &Addr, (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr),
    1101                                aSymbols[i].pvVar,  aSymbols[i].cbGuest);
     1110            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1111                                        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr,
     1112                                                                    (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr),
     1113                                        aSymbols[i].pvVar,  aSymbols[i].cbGuest);
    11021114            if (RT_SUCCESS(rc))
    11031115                continue;
     
    11201132        idxFirst = 0;
    11211133        idxNext = 0;
    1122         rc = dbgDiggerLinuxQueryLogBufferPtrs(pThis, pUVM, hMod, &GCPtrLogBuf, &cbLogBuf);
     1134        rc = dbgDiggerLinuxQueryLogBufferPtrs(pThis, pUVM, pVMM, hMod, &GCPtrLogBuf, &cbLogBuf);
    11231135        if (RT_FAILURE(rc))
    11241136        {
     
    11271139             * and try to deduce the boundaries from there.
    11281140             */
    1129             rc = dbgDiggerLinuxKrnlLogBufFindByNeedle(pThis, pUVM, &GCPtrLogBuf, &cbLogBuf);
    1130             return rc;
    1131         }
    1132     }
    1133 
    1134     return dbgDiggerLinuxKrnLogBufferProcess(pThis, pUVM, GCPtrLogBuf, cbLogBuf, idxFirst, idxNext,
     1141            return dbgDiggerLinuxKrnlLogBufFindByNeedle(pThis, pUVM, pVMM, &GCPtrLogBuf, &cbLogBuf);
     1142        }
     1143    }
     1144
     1145    return dbgDiggerLinuxKrnLogBufferProcess(pThis, pUVM, pVMM, GCPtrLogBuf, cbLogBuf, idxFirst, idxNext,
    11351146                                             fFlags, cMessages, pszBuf, cbBuf, pcbActual);
    11361147}
     
    11391150 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog}
    11401151 */
    1141 static DECLCALLBACK(int) dbgDiggerLinuxIDmsg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, uint32_t fFlags, uint32_t cMessages,
    1142                                                             char *pszBuf, size_t cbBuf, size_t *pcbActual)
     1152static DECLCALLBACK(int) dbgDiggerLinuxIDmsg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, uint32_t fFlags,
     1153                                                            uint32_t cMessages, char *pszBuf, size_t cbBuf, size_t *pcbActual)
    11431154{
    11441155    PDBGDIGGERLINUX pData = RT_FROM_MEMBER(pThis, DBGDIGGERLINUX, IDmesg);
     
    11501161     * Resolve the symbols we need and read their values.
    11511162     */
    1152     RTDBGAS  hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     1163    RTDBGAS  hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    11531164    RTDBGMOD hMod;
    11541165    int rc = RTDbgAsModuleByName(hAs, "vmlinux", 0, &hMod);
     
    11641175         * see: http://thread.gmane.org/gmane.linux.kernel/1284184
    11651176         */
    1166         if (dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM))
    1167             rc = dbgDiggerLinuxLogBufferQueryAscii(pData, pUVM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual);
     1177        if (dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM, pVMM))
     1178            rc = dbgDiggerLinuxLogBufferQueryAscii(pData, pUVM, pVMM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual);
    11681179        else
    1169             rc = dbgDiggerLinuxLogBufferQueryRecords(pData, pUVM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual);
     1180            rc = dbgDiggerLinuxLogBufferQueryRecords(pData, pUVM, pVMM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual);
    11701181
    11711182        /* Release the module in any case. */
     
    11781189         * require any symbols, try that here.
    11791190         */
    1180         if (!dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM))
     1191        if (!dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM, pVMM))
    11811192        {
    11821193            RTGCPTR GCPtrLogBuf = 0;
    11831194            uint32_t cbLogBuf = 0;
    11841195
    1185             rc = dbgDiggerLinuxKrnlLogBufFindByNeedle(pData, pUVM, &GCPtrLogBuf, &cbLogBuf);
     1196            rc = dbgDiggerLinuxKrnlLogBufFindByNeedle(pData, pUVM, pVMM, &GCPtrLogBuf, &cbLogBuf);
    11861197            if (RT_SUCCESS(rc))
    1187                 rc = dbgDiggerLinuxKrnLogBufferProcess(pData, pUVM, GCPtrLogBuf, cbLogBuf, 0 /*idxFirst*/, 0 /*idxNext*/,
     1198                rc = dbgDiggerLinuxKrnLogBufferProcess(pData, pUVM, pVMM, GCPtrLogBuf, cbLogBuf, 0 /*idxFirst*/, 0 /*idxNext*/,
    11881199                                                       fFlags, cMessages, pszBuf, cbBuf, &cbActual);
    11891200        }
     
    12491260 * @copydoc DBGFOSREG::pfnStackUnwindAssist
    12501261 */
    1251 static DECLCALLBACK(int) dbgDiggerLinuxStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,
    1252                                                          PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,
    1253                                                          uint64_t *puScratch)
    1254 {
    1255     RT_NOREF(pUVM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
     1262static DECLCALLBACK(int) dbgDiggerLinuxStackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu,
     1263                                                         PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx,
     1264                                                         RTDBGAS hAs, uint64_t *puScratch)
     1265{
     1266    RT_NOREF(pUVM, pVMM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
    12561267    return VINF_SUCCESS;
    12571268}
     
    12611272 * @copydoc DBGFOSREG::pfnQueryInterface
    12621273 */
    1263 static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    1264 {
    1265     RT_NOREF1(pUVM);
     1274static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf)
     1275{
    12661276    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     1277    RT_NOREF(pUVM, pVMM);
     1278
    12671279    switch (enmIf)
    12681280    {
     
    12791291 * @copydoc DBGFOSREG::pfnQueryVersion
    12801292 */
    1281 static DECLCALLBACK(int)  dbgDiggerLinuxQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
     1293static DECLCALLBACK(int)  dbgDiggerLinuxQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData,
     1294                                                     char *pszVersion, size_t cchVersion)
    12821295{
    12831296    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    12871300     * It's all in the linux banner.
    12881301     */
    1289     int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);
     1302    int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);
    12901303    if (RT_SUCCESS(rc))
    12911304    {
     
    13071320 * @copydoc DBGFOSREG::pfnTerm
    13081321 */
    1309 static DECLCALLBACK(void)  dbgDiggerLinuxTerm(PUVM pUVM, void *pvData)
     1322static DECLCALLBACK(void)  dbgDiggerLinuxTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    13101323{
    13111324    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    13201333     * Unlink and release our modules.
    13211334     */
    1322     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     1335    RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    13231336    if (hDbgAs != NIL_RTDBGAS)
    13241337    {
     
    13471360 * @copydoc DBGFOSREG::pfnRefresh
    13481361 */
    1349 static DECLCALLBACK(int)  dbgDiggerLinuxRefresh(PUVM pUVM, void *pvData)
     1362static DECLCALLBACK(int)  dbgDiggerLinuxRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    13501363{
    13511364    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
    1352     NOREF(pThis);
     1365    RT_NOREF(pThis);
    13531366    Assert(pThis->fValid);
    13541367
     
    13561369     * For now we'll flush and reload everything.
    13571370     */
    1358     dbgDiggerLinuxTerm(pUVM, pvData);
    1359     return dbgDiggerLinuxInit(pUVM, pvData);
     1371    dbgDiggerLinuxTerm(pUVM, pVMM, pvData);
     1372    return dbgDiggerLinuxInit(pUVM, pVMM, pvData);
    13601373}
    13611374
     
    13671380 * @returns VINF_SUCCESS.
    13681381 * @param   pThis               The Linux digger data to update.
     1382 * @param   pVMM                The VMM function table.
    13691383 * @param   pAddrKernelNames    The kallsyms_names address.
    13701384 * @param   cKernelSymbols      The number of kernel symbol.
    13711385 * @param   cbAddress           The guest address size.
    13721386 */
    1373 static int dbgDiggerLinuxFoundStartOfNames(PDBGDIGGERLINUX pThis, PCDBGFADDRESS pAddrKernelNames,
     1387static int dbgDiggerLinuxFoundStartOfNames(PDBGDIGGERLINUX pThis, PCVMMR3VTABLE pVMM, PCDBGFADDRESS pAddrKernelNames,
    13741388                                           uint32_t cKernelSymbols, uint32_t cbAddress)
    13751389{
     
    13891403        && (pThis->cKernelSymbols & 1))
    13901404        cbAlign = sizeof(int32_t);
    1391     DBGFR3AddrSub(&pThis->AddrKernelAddresses, cKernelSymbols * cbOffsets + cbSymbolsSkip + cbAlign);
     1405    pVMM->pfnDBGFR3AddrSub(&pThis->AddrKernelAddresses, cKernelSymbols * cbOffsets + cbSymbolsSkip + cbAlign);
    13921406
    13931407    Log(("dbgDiggerLinuxFoundStartOfNames: AddrKernelAddresses=%RGv\n"
     
    14121426 *          been found and taken down.
    14131427 * @param   pUVM                The user mode VM handle.
     1428 * @param   pVMM                The VMM function table.
    14141429 * @param   pThis               The Linux digger data.
    14151430 * @param   pHitAddr            An address we think is inside kallsyms_names.
    14161431 */
    1417 static int dbgDiggerLinuxFindStartOfNamesAndSymbolCount(PUVM pUVM, PDBGDIGGERLINUX pThis, PCDBGFADDRESS pHitAddr)
     1432static int dbgDiggerLinuxFindStartOfNamesAndSymbolCount(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis,
     1433                                                        PCDBGFADDRESS pHitAddr)
    14181434{
    14191435    /*
     
    14291445    uint32_t        cbBuf   = pHitAddr->FlatPtr & (sizeof(uBuf) - 1);
    14301446    DBGFADDRESS     CurAddr = *pHitAddr;
    1431     DBGFR3AddrSub(&CurAddr, cbBuf);
     1447    pVMM->pfnDBGFR3AddrSub(&CurAddr, cbBuf);
    14321448    cbBuf += sizeof(uint64_t) - 1;      /* In case our kobj hit is in the first 4/8 bytes. */
    14331449    for (;;)
    14341450    {
    1435         int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));
     1451        int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));
    14361452        if (RT_FAILURE(rc))
    14371453            return rc;
     
    15091525                            DBGFADDRESS RelAddr = CurAddr;
    15101526                            int32_t aiRelOff[3];
    1511                             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrAdd(&RelAddr, (i - 1) * sizeof(uint64_t) - sizeof(aiRelOff)),
    1512                                                &aiRelOff[0], sizeof(aiRelOff));
     1527                            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1528                                                        pVMM->pfnDBGFR3AddrAdd(&RelAddr,
     1529                                                                               (i - 1) * sizeof(uint64_t) - sizeof(aiRelOff)),
     1530                                                        &aiRelOff[0], sizeof(aiRelOff));
    15131531                            if (   RT_SUCCESS(rc)
    15141532                                && LNX64_VALID_ADDRESS(uKrnlRelBase + aiRelOff[0])
     
    15201538                                pThis->fRelKrnlAddr = true;
    15211539                                pThis->uKernelRelativeBase = uKrnlRelBase;
    1522                                 return dbgDiggerLinuxFoundStartOfNames(pThis,
    1523                                                                        DBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint64_t)),
     1540                                return dbgDiggerLinuxFoundStartOfNames(pThis, pVMM,
     1541                                                                       pVMM->pfnDBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint64_t)),
    15241542                                                                       (uint32_t)uBuf.au64[i], sizeof(uint64_t));
    15251543                            }
     
    15291547                            && (i <= 1 || LNX64_VALID_ADDRESS(uBuf.au64[i - 2]))
    15301548                            && (i <= 2 || LNX64_VALID_ADDRESS(uBuf.au64[i - 3])))
    1531                             return dbgDiggerLinuxFoundStartOfNames(pThis,
    1532                                                                    DBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint64_t)),
     1549                            return dbgDiggerLinuxFoundStartOfNames(pThis, pVMM,
     1550                                                                   pVMM->pfnDBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint64_t)),
    15331551                                                                   (uint32_t)uBuf.au64[i], sizeof(uint64_t));
    15341552                    }
     
    15571575                                pThis->fRelKrnlAddr = true;
    15581576                                pThis->uKernelRelativeBase = uKrnlRelBase;
    1559                                 return dbgDiggerLinuxFoundStartOfNames(pThis,
    1560                                                                        DBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint32_t)),
     1577                                return dbgDiggerLinuxFoundStartOfNames(pThis, pVMM,
     1578                                                                       pVMM->pfnDBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint32_t)),
    15611579                                                                       uBuf.au32[i], sizeof(uint32_t));
    15621580                            }
     
    15661584                            && (i <= 1 || LNX32_VALID_ADDRESS(uBuf.au32[i - 2]))
    15671585                            && (i <= 2 || LNX32_VALID_ADDRESS(uBuf.au32[i - 3])))
    1568                             return dbgDiggerLinuxFoundStartOfNames(pThis,
    1569                                                                    DBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint32_t)),
     1586                            return dbgDiggerLinuxFoundStartOfNames(pThis, pVMM,
     1587                                                                   pVMM->pfnDBGFR3AddrAdd(&CurAddr, (i + 1) * sizeof(uint32_t)),
    15701588                                                                   uBuf.au32[i], sizeof(uint32_t));
    15711589                    }
     
    15821600        }
    15831601        cbLeft -= sizeof(uBuf);
    1584         DBGFR3AddrSub(&CurAddr, sizeof(uBuf));
     1602        pVMM->pfnDBGFR3AddrSub(&CurAddr, sizeof(uBuf));
    15851603        cbBuf = sizeof(uBuf);
    15861604    }
     
    15931611 * @returns VINF_SUCCESS
    15941612 * @param   pThis           The linux digger data to update.
     1613 * @param   pVMM                The VMM function table.
    15951614 * @param   pAddrMarkers    The address of the marker (kallsyms_markers).
    15961615 * @param   cbMarkerEntry   The size of a marker entry (32-bit or 64-bit).
    15971616 */
    1598 static int dbgDiggerLinuxFoundMarkers(PDBGDIGGERLINUX pThis, PCDBGFADDRESS pAddrMarkers, uint32_t cbMarkerEntry)
     1617static int dbgDiggerLinuxFoundMarkers(PDBGDIGGERLINUX pThis, PCVMMR3VTABLE pVMM,
     1618                                      PCDBGFADDRESS pAddrMarkers, uint32_t cbMarkerEntry)
    15991619{
    16001620    pThis->cbKernelNames         = pAddrMarkers->FlatPtr - pThis->AddrKernelNames.FlatPtr;
     
    16021622    pThis->cKernelNameMarkers    = RT_ALIGN_32(pThis->cKernelSymbols, 256) / 256;
    16031623    pThis->AddrKernelTokenTable  = *pAddrMarkers;
    1604     DBGFR3AddrAdd(&pThis->AddrKernelTokenTable, pThis->cKernelNameMarkers * cbMarkerEntry);
     1624    pVMM->pfnDBGFR3AddrAdd(&pThis->AddrKernelTokenTable, pThis->cKernelNameMarkers * cbMarkerEntry);
    16051625
    16061626    Log(("dbgDiggerLinuxFoundMarkers: AddrKernelNames=%RGv cbKernelNames=%#x\n"
     
    16261646 *          been found and taken down.
    16271647 * @param   pUVM                The user mode VM handle.
     1648 * @param   pVMM                The VMM function table.
    16281649 * @param   pThis               The Linux digger data.
    16291650 * @param   pHitAddr            An address we think is inside kallsyms_names.
    16301651 */
    1631 static int dbgDiggerLinuxFindEndOfNamesAndMore(PUVM pUVM, PDBGDIGGERLINUX pThis, PCDBGFADDRESS pHitAddr)
     1652static int dbgDiggerLinuxFindEndOfNamesAndMore(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis, PCDBGFADDRESS pHitAddr)
    16321653{
    16331654    /*
     
    16441665    uint32_t        offBuf  = pHitAddr->FlatPtr & (sizeof(uBuf) - 1);
    16451666    DBGFADDRESS     CurAddr = *pHitAddr;
    1646     DBGFR3AddrSub(&CurAddr, offBuf);
     1667    pVMM->pfnDBGFR3AddrSub(&CurAddr, offBuf);
    16471668    for (;;)
    16481669    {
    1649         int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));
     1670        int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));
    16501671        if (RT_FAILURE(rc))
    16511672            return rc;
     
    16781699                && uBuf.au64[0] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256
    16791700                && uBuf.au64[0] <= (LNX_MAX_KALLSYMS_ENC_LENGTH + 1) * 256)
    1680                 return dbgDiggerLinuxFoundMarkers(pThis, DBGFR3AddrSub(&CurAddr, sizeof(uint64_t)), sizeof(uint64_t));
     1701                return dbgDiggerLinuxFoundMarkers(pThis, pVMM,
     1702                                                  pVMM->pfnDBGFR3AddrSub(&CurAddr, sizeof(uint64_t)), sizeof(uint64_t));
    16811703
    16821704            uint32_t const cEntries = sizeof(uBuf) / sizeof(uint64_t);
     
    16911713                    if (   uBuf.au64[i + 1] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256
    16921714                        && uBuf.au64[i + 1] <= (LNX_MAX_KALLSYMS_ENC_LENGTH + 1) * 256)
    1693                         return dbgDiggerLinuxFoundMarkers(pThis, DBGFR3AddrAdd(&CurAddr, i * sizeof(uint64_t)), sizeof(uint64_t));
     1715                        return dbgDiggerLinuxFoundMarkers(pThis, pVMM,
     1716                                                          pVMM->pfnDBGFR3AddrAdd(&CurAddr, i * sizeof(uint64_t)), sizeof(uint64_t));
    16941717                }
    16951718        }
     
    16991722                && uBuf.au32[0] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256
    17001723                && uBuf.au32[0] <= (LNX_MAX_KALLSYMS_ENC_LENGTH + 1) * 256)
    1701                 return dbgDiggerLinuxFoundMarkers(pThis, DBGFR3AddrSub(&CurAddr, sizeof(uint32_t)), sizeof(uint32_t));
     1724                return dbgDiggerLinuxFoundMarkers(pThis, pVMM,
     1725                                                  pVMM->pfnDBGFR3AddrSub(&CurAddr, sizeof(uint32_t)), sizeof(uint32_t));
    17021726
    17031727            uint32_t const cEntries = sizeof(uBuf) / sizeof(uint32_t);
     
    17121736                    if (   uBuf.au32[i + 1] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256
    17131737                        && uBuf.au32[i + 1] <= (LNX_MAX_KALLSYMS_ENC_LENGTH + 1) * 256)
    1714                         return dbgDiggerLinuxFoundMarkers(pThis, DBGFR3AddrAdd(&CurAddr, i * sizeof(uint32_t)), sizeof(uint32_t));
     1738                        return dbgDiggerLinuxFoundMarkers(pThis, pVMM,
     1739                                                          pVMM->pfnDBGFR3AddrAdd(&CurAddr, i * sizeof(uint32_t)), sizeof(uint32_t));
    17151740                }
    17161741        }
     
    17251750        }
    17261751        cbLeft -= sizeof(uBuf);
    1727         DBGFR3AddrAdd(&CurAddr, sizeof(uBuf));
     1752        pVMM->pfnDBGFR3AddrAdd(&CurAddr, sizeof(uBuf));
    17281753        offBuf = 0;
    17291754    }
     
    17391764 * @returns VBox status code.
    17401765 * @param   pUVM                The user mode VM handle.
     1766 * @param   pVMM                The VMM function table.
    17411767 * @param   pThis               The Linux digger data.
    17421768 */
    1743 static int dbgDiggerLinuxFindTokenIndex(PUVM pUVM, PDBGDIGGERLINUX pThis)
     1769static int dbgDiggerLinuxFindTokenIndex(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis)
    17441770{
    17451771    /*
     
    17561782    } uBuf;
    17571783    DBGFADDRESS CurAddr = pThis->AddrKernelTokenTable;
    1758     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));
     1784    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));
    17591785    if (RT_FAILURE(rc))
    17601786        return rc;
     
    17891815        {
    17901816            pThis->AddrKernelTokenIndex = CurAddr;
    1791             DBGFR3AddrAdd(&pThis->AddrKernelTokenIndex, i * sizeof(uint16_t));
     1817            pVMM->pfnDBGFR3AddrAdd(&pThis->AddrKernelTokenIndex, i * sizeof(uint16_t));
    17921818            pThis->cbKernelTokenTable = i * sizeof(uint16_t);
    17931819            return VINF_SUCCESS;
     
    18051831 * @returns VBox status code.
    18061832 * @param   pUVM                The user mode VM handle.
     1833 * @param   pVMM                The VMM function table.
    18071834 * @param   pThis               The Linux digger data.
    18081835 * @param   uKernelStart        Flat kernel start address.
     
    18111838 *                              relative to the start of the kernel.
    18121839 */
    1813 static int dbgDiggerLinuxLoadKernelSymbolsWorker(PUVM pUVM, PDBGDIGGERLINUX pThis, RTGCUINTPTR uKernelStart,
     1840static int dbgDiggerLinuxLoadKernelSymbolsWorker(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis, RTGCUINTPTR uKernelStart,
    18141841                                                 RTGCUINTPTR cbKernel, RTGCUINTPTR *pauSymOff)
    18151842{
    18161843    uint8_t *pbNames = (uint8_t *)RTMemAllocZ(pThis->cbKernelNames);
    1817     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelNames, pbNames, pThis->cbKernelNames);
     1844    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelNames, pbNames, pThis->cbKernelNames);
    18181845    if (RT_SUCCESS(rc))
    18191846    {
    18201847        char *pszzTokens = (char *)RTMemAllocZ(pThis->cbKernelTokenTable);
    1821         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelTokenTable, pszzTokens, pThis->cbKernelTokenTable);
     1848        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelTokenTable, pszzTokens, pThis->cbKernelTokenTable);
    18221849        if (RT_SUCCESS(rc))
    18231850        {
    18241851            uint16_t *paoffTokens = (uint16_t *)RTMemAllocZ(256 * sizeof(uint16_t));
    1825             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelTokenIndex, paoffTokens, 256 * sizeof(uint16_t));
     1852            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelTokenIndex, paoffTokens, 256 * sizeof(uint16_t));
    18261853            if (RT_SUCCESS(rc))
    18271854            {
     
    19151942                    if (RT_SUCCESS(rc))
    19161943                    {
    1917                         RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     1944                        RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    19181945                        if (hAs != NIL_RTDBGAS)
    19191946                            rc = RTDbgAsModuleLink(hAs, hMod, uKernelStart, RTDBGASLINK_FLAGS_REPLACE);
     
    19521979 * @returns VBox status code.
    19531980 * @param   pUVM                The user mode VM handle.
     1981 * @param   pVMM                The VMM function table.
    19541982 * @param   pThis               The Linux digger data.
    19551983 */
    1956 static int dbgDiggerLinuxLoadKernelSymbolsAbsolute(PUVM pUVM, PDBGDIGGERLINUX pThis)
     1984static int dbgDiggerLinuxLoadKernelSymbolsAbsolute(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis)
    19571985{
    19581986    /*
     
    19611989    uint32_t const cbGuestAddr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t);
    19621990    void *pvAddresses = RTMemAllocZ(pThis->cKernelSymbols * cbGuestAddr);
    1963     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelAddresses, pvAddresses, pThis->cKernelSymbols * cbGuestAddr);
     1991    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelAddresses,
     1992                                    pvAddresses, pThis->cKernelSymbols * cbGuestAddr);
    19641993    if (RT_SUCCESS(rc))
    19651994    {
     
    20102039        RTGCUINTPTR cbKernel = uKernelEnd - uKernelStart;
    20112040        pThis->cbKernel = (uint32_t)cbKernel;
    2012         DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart);
     2041        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart);
    20132042        Log(("dbgDiggerLinuxLoadKernelSymbolsAbsolute: uKernelStart=%RGv cbKernel=%#x\n", uKernelStart, cbKernel));
    20142043
    2015         rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, pThis, uKernelStart, cbKernel, pauSymOff);
     2044        rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, pVMM, pThis, uKernelStart, cbKernel, pauSymOff);
    20162045        if (RT_FAILURE(rc))
    20172046            Log(("dbgDiggerLinuxLoadKernelSymbolsAbsolute: Loading symbols from given offset table failed: %Rrc\n", rc));
     
    20322061 * @returns VBox status code.
    20332062 * @param   pUVM                The user mode VM handle.
     2063 * @param   pVMM                The VMM function table.
    20342064 * @param   pThis               The Linux digger data.
    20352065 */
    2036 static int dbgDiggerLinuxLoadKernelSymbolsRelative(PUVM pUVM, PDBGDIGGERLINUX pThis)
     2066static int dbgDiggerLinuxLoadKernelSymbolsRelative(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis)
    20372067{
    20382068    /*
     
    20402070     */
    20412071    int32_t *pai32Offsets = (int32_t *)RTMemAllocZ(pThis->cKernelSymbols * sizeof(int32_t));
    2042     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelAddresses, pai32Offsets, pThis->cKernelSymbols * sizeof(int32_t));
     2072    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &pThis->AddrKernelAddresses,
     2073                                    pai32Offsets, pThis->cKernelSymbols * sizeof(int32_t));
    20432074    if (RT_SUCCESS(rc))
    20442075    {
     
    20762107        RTGCUINTPTR cbKernel = uKernelEnd - uKernelStart;
    20772108        pThis->cbKernel = (uint32_t)cbKernel;
    2078         DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart);
     2109        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart);
    20792110        Log(("dbgDiggerLinuxLoadKernelSymbolsRelative: uKernelStart=%RGv cbKernel=%#x\n", uKernelStart, cbKernel));
    20802111
    2081         rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, pThis, uKernelStart, cbKernel, pauSymOff);
     2112        rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, pVMM, pThis, uKernelStart, cbKernel, pauSymOff);
    20822113        if (RT_FAILURE(rc))
    20832114            Log(("dbgDiggerLinuxLoadKernelSymbolsRelative: Loading symbols from given offset table failed: %Rrc\n", rc));
     
    20982129 * @returns VBox status code.
    20992130 * @param   pUVM                The user mode VM handle.
     2131 * @param   pVMM                The VMM function table.
    21002132 * @param   pThis               The Linux digger data.
    21012133 */
    2102 static int dbgDiggerLinuxLoadKernelSymbols(PUVM pUVM, PDBGDIGGERLINUX pThis)
     2134static int dbgDiggerLinuxLoadKernelSymbols(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis)
    21032135{
    21042136    /*
     
    21062138     */
    21072139    if (pThis->fRelKrnlAddr)
    2108         return dbgDiggerLinuxLoadKernelSymbolsRelative(pUVM, pThis);
    2109     return dbgDiggerLinuxLoadKernelSymbolsAbsolute(pUVM, pThis);
     2140        return dbgDiggerLinuxLoadKernelSymbolsRelative(pUVM, pVMM, pThis);
     2141    return dbgDiggerLinuxLoadKernelSymbolsAbsolute(pUVM, pVMM, pThis);
    21102142}
    21112143
     
    21332165    uint32_t    uVersion;
    21342166    bool        f64Bit;
    2135     uint64_t  (*pfnProcessModule)(PDBGDIGGERLINUX pThis, PUVM pUVM, PDBGFADDRESS pAddrModule);
     2167    uint64_t  (*pfnProcessModule)(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGFADDRESS pAddrModule);
    21362168} g_aModVersions[] =
    21372169{
     
    21562188 * @param   pThis               The Linux digger data.
    21572189 * @param   pUVM                The user mode VM handle.
    2158  */
    2159 static int dbgDiggerLinuxLoadModules(PDBGDIGGERLINUX pThis, PUVM pUVM)
     2190 * @param   pVMM                The VMM function table.
     2191 */
     2192static int dbgDiggerLinuxLoadModules(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM)
    21602193{
    21612194    /*
    21622195     * Locate the list head.
    21632196     */
    2164     RTDBGAS     hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     2197    RTDBGAS     hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    21652198    RTDBGSYMBOL SymInfo;
    21662199    int rc = RTDbgAsSymbolByName(hAs, "vmlinux!modules", &SymInfo, NULL);
     
    21842217    } uListAnchor;
    21852218    DBGFADDRESS Addr;
    2186     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, SymInfo.Value),
    2187                        &uListAnchor, pThis->f64Bit ? sizeof(uListAnchor.u64Pair) : sizeof(uListAnchor.u32Pair));
     2219    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SymInfo.Value),
     2220                                &uListAnchor, pThis->f64Bit ? sizeof(uListAnchor.u64Pair) : sizeof(uListAnchor.u32Pair));
    21882221    if (RT_FAILURE(rc))
    21892222    {
     
    22292262    uint64_t uModAddr = uListAnchor.u64Pair[0];
    22302263    for (size_t iModule = 0; iModule < 4096 && uModAddr != SymInfo.Value && uModAddr != 0; iModule++)
    2231         uModAddr = g_aModVersions[i].pfnProcessModule(pThis, pUVM, DBGFR3AddrFromFlat(pUVM, &Addr, uModAddr));
     2264        uModAddr = g_aModVersions[i].pfnProcessModule(pThis, pUVM, pVMM, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uModAddr));
    22322265
    22332266    return VINF_SUCCESS;
     
    22402273 * @returns true if it's a likely fragment, false if not.
    22412274 * @param   pUVM                The user mode VM handle.
     2275 * @param   pVMM                The VMM function table.
    22422276 * @param   pHitAddr            The address where paNeedle was found.
    22432277 * @param   pabNeedle           The fragment we've been searching for.
    22442278 * @param   cbNeedle            The length of the fragment.
    22452279 */
    2246 static bool dbgDiggerLinuxIsLikelyNameFragment(PUVM pUVM, PCDBGFADDRESS pHitAddr, uint8_t const *pabNeedle, uint8_t cbNeedle)
     2280static bool dbgDiggerLinuxIsLikelyNameFragment(PUVM pUVM, PCVMMR3VTABLE pVMM, PCDBGFADDRESS pHitAddr,
     2281                                               uint8_t const *pabNeedle, uint8_t cbNeedle)
    22472282{
    22482283    /*
     
    22692304    uint8_t         abBuf[32];
    22702305    DBGFADDRESS     ReadAddr = *pHitAddr;
    2271     DBGFR3AddrSub(&ReadAddr, 2);
    2272     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &ReadAddr, abBuf, 2 + cbNeedle + 2);
     2306    pVMM->pfnDBGFR3AddrSub(&ReadAddr, 2);
     2307    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &ReadAddr, abBuf, 2 + cbNeedle + 2);
    22732308    if (RT_SUCCESS(rc))
    22742309    {
     
    22992334 * @param   pThis               The Linux digger data.
    23002335 * @param   pUVM                The user mode VM handle.
     2336 * @param   pVMM                The VMM function table.
    23012337 * @param   pabNeedle           The needle to use for searching.
    23022338 * @param   cbNeedle            Size of the needle in bytes.
    23032339 */
    2304 static int dbgDiggerLinuxFindSymbolTableFromNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, uint8_t const *pabNeedle, uint8_t cbNeedle)
    2305 {
    2306     int rc = VINF_SUCCESS;
    2307 
     2340static int dbgDiggerLinuxFindSymbolTableFromNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     2341                                                   uint8_t const *pabNeedle, uint8_t cbNeedle)
     2342{
    23082343    /*
    23092344     * Go looking for the kallsyms table.  If it's there, it will be somewhere
    23102345     * after the linux_banner symbol, so use it for starting the search.
    23112346     */
     2347    int         rc      = VINF_SUCCESS;
    23122348    DBGFADDRESS CurAddr = pThis->AddrLinuxBanner;
    23132349    uint32_t    cbLeft  = LNX_MAX_KERNEL_SIZE;
     
    23152351    {
    23162352        DBGFADDRESS          HitAddr;
    2317         rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &CurAddr, cbLeft, 1 /*uAlign*/,
    2318                            pabNeedle, cbNeedle, &HitAddr);
     2353        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &CurAddr, cbLeft, 1 /*uAlign*/,
     2354                                    pabNeedle, cbNeedle, &HitAddr);
    23192355        if (RT_FAILURE(rc))
    23202356            break;
    2321         if (dbgDiggerLinuxIsLikelyNameFragment(pUVM, &HitAddr, pabNeedle, cbNeedle))
     2357        if (dbgDiggerLinuxIsLikelyNameFragment(pUVM, pVMM, &HitAddr, pabNeedle, cbNeedle))
    23222358        {
    23232359            /* There will be another hit near by. */
    2324             DBGFR3AddrAdd(&HitAddr, 1);
    2325             rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, LNX_MAX_KALLSYMS_NAMES_SIZE, 1 /*uAlign*/,
    2326                                pabNeedle, cbNeedle, &HitAddr);
     2360            pVMM->pfnDBGFR3AddrAdd(&HitAddr, 1);
     2361            rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, LNX_MAX_KALLSYMS_NAMES_SIZE, 1 /*uAlign*/,
     2362                                        pabNeedle, cbNeedle, &HitAddr);
    23272363            if (   RT_SUCCESS(rc)
    2328                 && dbgDiggerLinuxIsLikelyNameFragment(pUVM, &HitAddr, pabNeedle, cbNeedle))
     2364                && dbgDiggerLinuxIsLikelyNameFragment(pUVM, pVMM, &HitAddr, pabNeedle, cbNeedle))
    23292365            {
    23302366                /*
     
    23332369                 * kallsyms_num_syms is aligned on sizeof(unsigned long) boundrary
    23342370                 */
    2335                 rc = dbgDiggerLinuxFindStartOfNamesAndSymbolCount(pUVM, pThis, &HitAddr);
     2371                rc = dbgDiggerLinuxFindStartOfNamesAndSymbolCount(pUVM, pVMM, pThis, &HitAddr);
    23362372                if (RT_SUCCESS(rc))
    2337                     rc = dbgDiggerLinuxFindEndOfNamesAndMore(pUVM, pThis, &HitAddr);
     2373                    rc = dbgDiggerLinuxFindEndOfNamesAndMore(pUVM, pVMM, pThis, &HitAddr);
    23382374                if (RT_SUCCESS(rc))
    2339                     rc = dbgDiggerLinuxFindTokenIndex(pUVM, pThis);
     2375                    rc = dbgDiggerLinuxFindTokenIndex(pUVM, pVMM, pThis);
    23402376                if (RT_SUCCESS(rc))
    2341                     rc = dbgDiggerLinuxLoadKernelSymbols(pUVM, pThis);
     2377                    rc = dbgDiggerLinuxLoadKernelSymbols(pUVM, pVMM, pThis);
    23422378                if (RT_SUCCESS(rc))
    23432379                {
    2344                     rc = dbgDiggerLinuxLoadModules(pThis, pUVM);
     2380                    rc = dbgDiggerLinuxLoadModules(pThis, pUVM, pVMM);
    23452381                    break;
    23462382                }
     
    23582394        }
    23592395        cbLeft -= cbDistance;
    2360         DBGFR3AddrAdd(&CurAddr, cbDistance);
    2361 
     2396        pVMM->pfnDBGFR3AddrAdd(&CurAddr, cbDistance);
    23622397    }
    23632398
     
    26662701 * @param   pThis               The Linux digger data.
    26672702 * @param   pUVM                The user mode VM handle.
     2703 * @param   pVMM                The VMM function table.
    26682704 * @param   pAddrStart          The start address of the compressed config.
    26692705 * @param   cbCfgComp           The size of the compressed config.
    26702706 */
    2671 static int dbgDiggerLinuxCfgDecode(PDBGDIGGERLINUX pThis, PUVM pUVM,
     2707static int dbgDiggerLinuxCfgDecode(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
    26722708                                   PCDBGFADDRESS pAddrStart, size_t cbCfgComp)
    26732709{
     
    26772713        return VERR_NO_MEMORY;
    26782714
    2679     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrStart, pbCfgComp, cbCfgComp);
     2715    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrStart, pbCfgComp, cbCfgComp);
    26802716    if (RT_SUCCESS(rc))
    26812717    {
     
    27032739 * @param   pThis               The Linux digger data.
    27042740 * @param   pUVM                The user mode VM handle.
    2705  */
    2706 static int dbgDiggerLinuxCfgFind(PDBGDIGGERLINUX pThis, PUVM pUVM)
    2707 {
    2708     int rc = VINF_SUCCESS;
    2709 
     2741 * @param   pVMM                The VMM function table.
     2742 */
     2743static int dbgDiggerLinuxCfgFind(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM)
     2744{
    27102745    /*
    27112746     * Go looking for the IKCFG_ST string which indicates the start
     
    27142749    static const uint8_t s_abCfgNeedleStart[] = "IKCFG_ST";
    27152750    static const uint8_t s_abCfgNeedleEnd[] = "IKCFG_ED";
     2751    int         rc      = VINF_SUCCESS;
    27162752    DBGFADDRESS CurAddr = pThis->AddrLinuxBanner;
    27172753    uint32_t    cbLeft  = LNX_MAX_KERNEL_SIZE;
     
    27192755    {
    27202756        DBGFADDRESS HitAddrStart;
    2721         rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &CurAddr, cbLeft, 1 /*uAlign*/,
    2722                            s_abCfgNeedleStart, sizeof(s_abCfgNeedleStart) - 1, &HitAddrStart);
     2757        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &CurAddr, cbLeft, 1 /*uAlign*/,
     2758                                    s_abCfgNeedleStart, sizeof(s_abCfgNeedleStart) - 1, &HitAddrStart);
    27232759        if (RT_FAILURE(rc))
    27242760            break;
    27252761
    27262762        /* Check for the end marker which shouldn't be that far away. */
    2727         DBGFR3AddrAdd(&HitAddrStart, sizeof(s_abCfgNeedleStart) - 1);
     2763        pVMM->pfnDBGFR3AddrAdd(&HitAddrStart, sizeof(s_abCfgNeedleStart) - 1);
    27282764        DBGFADDRESS HitAddrEnd;
    2729         rc = DBGFR3MemScan(pUVM, 0 /* idCpu */, &HitAddrStart, LNX_MAX_COMPRESSED_CFG_SIZE,
    2730                            1 /* uAlign */, s_abCfgNeedleEnd, sizeof(s_abCfgNeedleEnd) - 1, &HitAddrEnd);
     2765        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /* idCpu */, &HitAddrStart, LNX_MAX_COMPRESSED_CFG_SIZE,
     2766                                    1 /* uAlign */, s_abCfgNeedleEnd, sizeof(s_abCfgNeedleEnd) - 1, &HitAddrEnd);
    27312767        if (RT_SUCCESS(rc))
    27322768        {
     
    27342770            RTGCUINTPTR cbCfg = HitAddrEnd.FlatPtr - HitAddrStart.FlatPtr;
    27352771            Assert(cbCfg == (size_t)cbCfg);
    2736             rc = dbgDiggerLinuxCfgDecode(pThis, pUVM, &HitAddrStart, cbCfg);
     2772            rc = dbgDiggerLinuxCfgDecode(pThis, pUVM, pVMM, &HitAddrStart, cbCfg);
    27372773            if (RT_SUCCESS(rc))
    27382774                break;
     
    27492785        }
    27502786        cbLeft -= cbDistance;
    2751         DBGFR3AddrAdd(&CurAddr, cbDistance);
    2752 
     2787        pVMM->pfnDBGFR3AddrAdd(&CurAddr, cbDistance);
    27532788    }
    27542789
     
    27622797 * @param   pThis               The Linux digger data.
    27632798 * @param   pUVM                The user mode VM handle.
     2799 * @param   pVMM                The VMM function table.
    27642800 * @param   uAddrStart          The address to start scanning at.
    27652801 * @param   cbScan              How much to scan.
    27662802 */
    2767 static bool dbgDiggerLinuxProbeWithAddr(PDBGDIGGERLINUX pThis, PUVM pUVM, RTGCUINTPTR uAddrStart, size_t cbScan)
     2803static bool dbgDiggerLinuxProbeWithAddr(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     2804                                        RTGCUINTPTR uAddrStart, size_t cbScan)
    27682805{
    27692806    /*
     
    27722809     */
    27732810    DBGFADDRESS KernelAddr;
    2774     DBGFR3AddrFromFlat(pUVM, &KernelAddr, uAddrStart);
     2811    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, uAddrStart);
    27752812    DBGFADDRESS HitAddr;
    2776     int rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, cbScan, 1,
    2777                            g_abLinuxVersion, sizeof(g_abLinuxVersion) - 1, &HitAddr);
     2813    int rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &KernelAddr, cbScan, 1,
     2814                                    g_abLinuxVersion, sizeof(g_abLinuxVersion) - 1, &HitAddr);
    27782815    if (RT_SUCCESS(rc))
    27792816    {
    27802817        char szTmp[128];
    27812818        char const *pszX = &szTmp[sizeof(g_abLinuxVersion) - 1];
    2782         rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp));
     2819        rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp));
    27832820        if (    RT_SUCCESS(rc)
    27842821            &&  (   (   pszX[0] == '2'  /* 2.x.y with x in {0..6} */
     
    28092846 * @param   pThis               The Linux digger data.
    28102847 * @param   pUVM                The user mode VM handle.
    2811  */
    2812 static bool dbgDiggerLinuxProbeKaslr(PDBGDIGGERLINUX pThis, PUVM pUVM)
     2848 * @param   pVMM                The VMM function table.
     2849 */
     2850static bool dbgDiggerLinuxProbeKaslr(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM)
    28132851{
    28142852    /**
     
    28372875     * So the highest offset the kernel can start is 0x40000000 which is 1GB (plus the maximum kernel size we defined).
    28382876     */
    2839     if (dbgDiggerLinuxProbeWithAddr(pThis, pUVM, LNX64_KERNEL_ADDRESS_START, _1G + LNX_MAX_KERNEL_SIZE))
     2877    if (dbgDiggerLinuxProbeWithAddr(pThis, pUVM, pVMM, LNX64_KERNEL_ADDRESS_START, _1G + LNX_MAX_KERNEL_SIZE))
    28402878        return true;
    28412879
     
    28462884     * The default split is 3GB userspace and 1GB kernel, so we just search the entire upper 1GB kernel space.
    28472885     */
    2848     if (dbgDiggerLinuxProbeWithAddr(pThis, pUVM, LNX32_KERNEL_ADDRESS_START, _4G - LNX32_KERNEL_ADDRESS_START))
     2886    if (dbgDiggerLinuxProbeWithAddr(pThis, pUVM, pVMM, LNX32_KERNEL_ADDRESS_START, _4G - LNX32_KERNEL_ADDRESS_START))
    28492887        return true;
    28502888
     
    28552893 * @copydoc DBGFOSREG::pfnInit
    28562894 */
    2857 static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, void *pvData)
     2895static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    28582896{
    28592897    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    28612899
    28622900    char szVersion[256] = "Linux version 4.19.0";
    2863     int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, &szVersion[0], sizeof(szVersion));
     2901    int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, &szVersion[0], sizeof(szVersion));
    28642902    if (RT_SUCCESS(rc))
    28652903    {
     
    29112949     * the method to use.
    29122950     */
    2913     rc = dbgDiggerLinuxCfgFind(pThis, pUVM);
     2951    rc = dbgDiggerLinuxCfgFind(pThis, pUVM, pVMM);
    29142952    if (RT_FAILURE(rc))
    29152953        LogFlowFunc(("Failed to find kernel config (%Rrc), no config database available\n", rc));
    29162954
    29172955    static const uint8_t s_abNeedle[] = "kobj";
    2918     rc = dbgDiggerLinuxFindSymbolTableFromNeedle(pThis, pUVM, s_abNeedle, sizeof(s_abNeedle) - 1);
     2956    rc = dbgDiggerLinuxFindSymbolTableFromNeedle(pThis, pUVM, pVMM, s_abNeedle, sizeof(s_abNeedle) - 1);
    29192957    if (RT_FAILURE(rc))
    29202958    {
    29212959        /* Try alternate needle (seen on older x86 Linux kernels). */
    29222960        static const uint8_t s_abNeedleAlt[] = "kobjec";
    2923         rc = dbgDiggerLinuxFindSymbolTableFromNeedle(pThis, pUVM, s_abNeedleAlt, sizeof(s_abNeedleAlt) - 1);
     2961        rc = dbgDiggerLinuxFindSymbolTableFromNeedle(pThis, pUVM, pVMM, s_abNeedleAlt, sizeof(s_abNeedleAlt) - 1);
    29242962        if (RT_FAILURE(rc))
    29252963        {
    29262964            static const uint8_t s_abNeedleOSuseX86[] = "nmi"; /* OpenSuSe 10.2 x86 */
    2927             rc = dbgDiggerLinuxFindSymbolTableFromNeedle(pThis, pUVM, s_abNeedleOSuseX86, sizeof(s_abNeedleOSuseX86) - 1);
     2965            rc = dbgDiggerLinuxFindSymbolTableFromNeedle(pThis, pUVM, pVMM, s_abNeedleOSuseX86, sizeof(s_abNeedleOSuseX86) - 1);
    29282966        }
    29292967    }
     
    29372975 * @copydoc DBGFOSREG::pfnProbe
    29382976 */
    2939 static DECLCALLBACK(bool)  dbgDiggerLinuxProbe(PUVM pUVM, void *pvData)
     2977static DECLCALLBACK(bool)  dbgDiggerLinuxProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    29402978{
    29412979    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    29432981    for (unsigned i = 0; i < RT_ELEMENTS(g_au64LnxKernelAddresses); i++)
    29442982    {
    2945         if (dbgDiggerLinuxProbeWithAddr(pThis, pUVM, g_au64LnxKernelAddresses[i], LNX_MAX_KERNEL_SIZE))
     2983        if (dbgDiggerLinuxProbeWithAddr(pThis, pUVM, pVMM, g_au64LnxKernelAddresses[i], LNX_MAX_KERNEL_SIZE))
    29462984            return true;
    29472985    }
    29482986
    29492987    /* Maybe the kernel uses KASLR. */
    2950     if (dbgDiggerLinuxProbeKaslr(pThis, pUVM))
     2988    if (dbgDiggerLinuxProbeKaslr(pThis, pUVM, pVMM))
    29512989        return true;
    29522990
     
    29582996 * @copydoc DBGFOSREG::pfnDestruct
    29592997 */
    2960 static DECLCALLBACK(void)  dbgDiggerLinuxDestruct(PUVM pUVM, void *pvData)
    2961 {
    2962     RT_NOREF2(pUVM, pvData);
     2998static DECLCALLBACK(void)  dbgDiggerLinuxDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     2999{
     3000    RT_NOREF(pUVM, pVMM, pvData);
    29633001}
    29643002
     
    29673005 * @copydoc DBGFOSREG::pfnConstruct
    29683006 */
    2969 static DECLCALLBACK(int)  dbgDiggerLinuxConstruct(PUVM pUVM, void *pvData)
    2970 {
    2971     RT_NOREF1(pUVM);
     3007static DECLCALLBACK(int)  dbgDiggerLinuxConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     3008{
     3009    RT_NOREF(pUVM, pVMM);
    29723010    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
    29733011    pThis->IDmesg.u32Magic = DBGFOSIDMESG_MAGIC;
  • trunk/src/VBox/Debugger/DBGPlugInLinuxModuleCodeTmpl.cpp.h

    r93115 r93470  
    395395 * @param   cSyms               Number of symbols in the array.
    396396 */
    397 static int RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(PUVM pUVM, RTDBGMOD hDbgMod, LNX_PTR_T uPtrModuleStart, LNX_PTR_T uPtrSymStart, uint32_t cSyms)
     397static int RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hDbgMod,
     398                                                                 LNX_PTR_T uPtrModuleStart, LNX_PTR_T uPtrSymStart, uint32_t cSyms)
    398399{
    399400    int rc = VINF_SUCCESS;
    400401    DBGFADDRESS AddrSym;
    401     DBGFR3AddrFromFlat(pUVM, &AddrSym, uPtrSymStart);
     402    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrSym, uPtrSymStart);
    402403
    403404    while (   cSyms
     
    407408        uint32_t cThisLoad = RT_MIN(cSyms, RT_ELEMENTS(aSyms));
    408409
    409         rc = DBGFR3MemRead(pUVM, 0, &AddrSym, &aSyms[0], cThisLoad * sizeof(aSyms[0]));
     410        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &AddrSym, &aSyms[0], cThisLoad * sizeof(aSyms[0]));
    410411        if (RT_SUCCESS(rc))
    411412        {
    412413            cSyms -= cThisLoad;
    413             DBGFR3AddrAdd(&AddrSym, cThisLoad * sizeof(aSyms[0]));
     414            pVMM->pfnDBGFR3AddrAdd(&AddrSym, cThisLoad * sizeof(aSyms[0]));
    414415
    415416            for (uint32_t i = 0; i < cThisLoad; i++)
     
    417418                char szSymName[128];
    418419                DBGFADDRESS AddrSymName;
    419                 rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &AddrSymName, aSyms[i].uPtrSymName),
    420                                    &szSymName[0], sizeof(szSymName));
     420                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrSymName, aSyms[i].uPtrSymName),
     421                                            &szSymName[0], sizeof(szSymName));
    421422                if (RT_FAILURE(rc))
    422423                    break;
     
    428429
    429430                Assert(aSyms[i].uValue >= uPtrModuleStart);
    430                 rc = RTDbgModSymbolAdd(hDbgMod, szSymName, RTDBGSEGIDX_RVA, aSyms[i].uValue - uPtrModuleStart, 0 /*cb*/, 0 /*fFlags*/, NULL);
     431                rc = RTDbgModSymbolAdd(hDbgMod, szSymName, RTDBGSEGIDX_RVA, aSyms[i].uValue - uPtrModuleStart,
     432                                       0 /*cb*/, 0 /*fFlags*/, NULL);
    431433                if (RT_SUCCESS(rc))
    432434                    LogFlowFunc(("Added symbol '%s' successfully\n", szSymName));
     
    447449 * Version specific module processing code.
    448450 */
    449 static uint64_t RT_CONCAT(dbgDiggerLinuxLoadModule,LNX_SUFFIX)(PDBGDIGGERLINUX pThis, PUVM pUVM, PDBGFADDRESS pAddrModule)
     451static uint64_t RT_CONCAT(dbgDiggerLinuxLoadModule,LNX_SUFFIX)(PDBGDIGGERLINUX pThis, PUVM pUVM,
     452                                                               PCVMMR3VTABLE pVMM, PDBGFADDRESS pAddrModule)
    450453{
    451454    RT_CONCAT(LNXKMODULE,LNX_SUFFIX) Module;
    452455
    453     int rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrSub(pAddrModule, RT_UOFFSETOF(RT_CONCAT(LNXKMODULE,LNX_SUFFIX), uPtrNext)),
    454                            &Module, sizeof(Module));
     456    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrSub(pAddrModule, RT_UOFFSETOF(RT_CONCAT(LNXKMODULE,LNX_SUFFIX),
     457                                                                                              uPtrNext)),
     458                                    &Module, sizeof(Module));
    455459    if (RT_FAILURE(rc))
    456460    {
     
    495499        if (RT_SUCCESS(rc))
    496500        {
    497             RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     501            RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    498502            rc = RTDbgAsModuleLink(hAs, hDbgMod, uPtrModuleCore, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/);
    499503            RTDbgAsRelease(hAs);
    500504            if (RT_SUCCESS(rc))
    501505            {
    502                 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,
     506                rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore,
    503507                                                                           Module.uPtrSyms, Module.num_syms);
    504508                if (RT_FAILURE(rc))
     
    506510
    507511#if LNX_VER >= LNX_MK_VER(2,5,55)
    508                 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,
     512                rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore,
    509513                                                                           Module.uPtrGplSyms, Module.num_gpl_syms);
    510514                if (RT_FAILURE(rc))
     
    513517
    514518#if LNX_VER >= LNX_MK_VER(2,6,17)
    515                 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,
     519                rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore,
    516520                                                                           Module.uPtrGplFutureSyms, Module.num_gpl_future_syms);
    517521                if (RT_FAILURE(rc))
     
    520524
    521525#if LNX_VER >= LNX_MK_VER(2,6,18)
    522                 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,
     526                rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore,
    523527                                                                           Module.uPtrUnusedSyms, Module.num_unused_syms);
    524528                if (RT_FAILURE(rc))
    525529                    LogRelFunc((" Faild to load unused symbols: %Rrc\n", rc));
    526530
    527                 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,
     531                rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore,
    528532                                                                           Module.uPtrUnusedGplSyms, Module.num_unused_gpl_syms);
    529533                if (RT_FAILURE(rc))
  • trunk/src/VBox/Debugger/DBGPlugInOS2.cpp

    r93115 r93470  
    2222#define LOG_GROUP LOG_GROUP_DBGF /// @todo add new log group.
    2323#include "DBGPlugIns.h"
    24 #include <VBox/vmm/dbgf.h>
     24#include <VBox/vmm/vmmr3vtable.h>
    2525#include <VBox/err.h>
    2626#include <VBox/param.h>
     
    5151    /** The user-mode VM handle for use in info handlers. */
    5252    PUVM                pUVM;
     53    /** The VMM function table for use in info handlers. */
     54    PCVMMR3VTABLE       pVMM;
    5355
    5456    /** Whether the information is valid or not.
     
    408410*   Internal Functions                                                                                                           *
    409411*********************************************************************************************************************************/
    410 static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, void *pvData);
     412static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData);
    411413
    412414
     
    415417{
    416418    RT_ZERO(*pSelInfo);
    417     int rc = DBGFR3SelQueryInfo(pThis->pUVM, 0 /*idCpu*/, uSel, DBGFSELQI_FLAGS_DT_GUEST, pSelInfo);
     419    int rc = pThis->pVMM->pfnDBGFR3SelQueryInfo(pThis->pUVM, 0 /*idCpu*/, uSel, DBGFSELQI_FLAGS_DT_GUEST, pSelInfo);
    418420    if (RT_SUCCESS(rc))
    419421    {
     
    447449{
    448450    RT_NOREF(pszArgs);
    449     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
    450     DBGFSELINFO   SelInfo;
    451     int rc = DBGFR3SelQueryInfo(pThis->pUVM, 0 /*idCpu*/, 0x70, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
     451    PDBGDIGGEROS2 const pThis = (PDBGDIGGEROS2)pvUser;
     452    PUVM const          pUVM  = pThis->pUVM;
     453    PCVMMR3VTABLE const pVMM  = pThis->pVMM;
     454
     455    DBGFSELINFO SelInfo;
     456    int rc = pVMM->pfnDBGFR3SelQueryInfo(pUVM, 0 /*idCpu*/, 0x70, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
    452457    if (RT_FAILURE(rc))
    453458    {
     
    467472    };
    468473    DBGFADDRESS Addr;
    469     rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase), &Sas, sizeof(Sas));
     474    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SelInfo.GCPtrBase),
     475                                &Sas, sizeof(Sas));
    470476    if (RT_FAILURE(rc))
    471477    {
     
    511517     * Info data.
    512518     */
    513     rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase + Sas.SAS_info_data),
    514                        &u.Info, sizeof(u.Info));
     519    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     520                                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SelInfo.GCPtrBase + Sas.SAS_info_data),
     521                                &u.Info, sizeof(u.Info));
    515522    if (RT_SUCCESS(rc))
    516523    {
     
    535542{
    536543    RT_NOREF(pszArgs);
    537     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
    538     DBGFSELINFO   SelInfo;
     544    PDBGDIGGEROS2 const pThis = (PDBGDIGGEROS2)pvUser;
     545    PUVM const          pUVM  = pThis->pUVM;
     546    PCVMMR3VTABLE const pVMM  = pThis->pVMM;
     547
     548    DBGFSELINFO SelInfo;
    539549    int rc = dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, pThis->selGis, UINT32_MAX, 0, "Global info segment", &SelInfo);
    540550    if (RT_FAILURE(rc))
     
    547557    OS2GIS      Gis;
    548558    RT_ZERO(Gis);
    549     rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase), &Gis,
    550                        RT_MIN(sizeof(Gis), SelInfo.cbLimit + 1));
     559    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SelInfo.GCPtrBase), &Gis,
     560                                RT_MIN(sizeof(Gis), SelInfo.cbLimit + 1));
    551561    if (RT_FAILURE(rc))
    552562    {
     
    591601{
    592602    RT_NOREF(pszArgs);
    593     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
    594     DBGFSELINFO   SelInfo;
     603    PDBGDIGGEROS2 const pThis = (PDBGDIGGEROS2)pvUser;
     604    PUVM const          pUVM  = pThis->pUVM;
     605    PCVMMR3VTABLE const pVMM  = pThis->pVMM;
     606
     607    DBGFSELINFO SelInfo;
    595608    int rc = dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, pThis->Lis.sel, pThis->Lis.off, 19, "Local info segment", &SelInfo);
    596609    if (RT_FAILURE(rc))
     
    603616    OS2LIS      Lis;
    604617    RT_ZERO(Lis);
    605     rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase + pThis->Lis.off),
    606                        &Lis, sizeof(Lis));
     618    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SelInfo.GCPtrBase + pThis->Lis.off),
     619                                &Lis, sizeof(Lis));
    607620    if (RT_FAILURE(rc))
    608621    {
     
    639652{
    640653    RT_NOREF(pszArgs);
    641     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
    642     DBGFADDRESS   HitAddr;
    643     int rc = DBGFR3MemScan(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &HitAddr, pThis->uKernelAddr),
    644                            pThis->cbKernel, 1, RT_STR_TUPLE("Exception in module:"), &HitAddr);
     654    PDBGDIGGEROS2 const pThis = (PDBGDIGGEROS2)pvUser;
     655    PUVM const          pUVM  = pThis->pUVM;
     656    PCVMMR3VTABLE const pVMM  = pThis->pVMM;
     657
     658    DBGFADDRESS HitAddr;
     659    int rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &HitAddr, pThis->uKernelAddr),
     660                                    pThis->cbKernel, 1, RT_STR_TUPLE("Exception in module:"), &HitAddr);
    645661    if (RT_FAILURE(rc))
    646         rc = DBGFR3MemScan(pThis->pUVM, 0 /*idCpu&*/, DBGFR3AddrFromFlat(pThis->pUVM, &HitAddr, pThis->uKernelAddr),
    647                            pThis->cbKernel, 1, RT_STR_TUPLE("Exception in device driver:"), &HitAddr);
     662        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu&*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &HitAddr, pThis->uKernelAddr),
     663                                    pThis->cbKernel, 1, RT_STR_TUPLE("Exception in device driver:"), &HitAddr);
    648664    /** @todo support pre-2001 kernels w/o the module/drivce name.   */
    649665    if (RT_SUCCESS(rc))
     
    651667        char szMsg[728 + 1];
    652668        RT_ZERO(szMsg);
    653         rc = DBGFR3MemRead(pThis->pUVM, 0, &HitAddr, szMsg, sizeof(szMsg) - 1);
     669        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &HitAddr, szMsg, sizeof(szMsg) - 1);
    654670        if (szMsg[0] != '\0')
    655671        {
     
    681697 * @copydoc DBGFOSREG::pfnStackUnwindAssist
    682698 */
    683 static DECLCALLBACK(int) dbgDiggerOS2StackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,
    684                                                        PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,
    685                                                        uint64_t *puScratch)
    686 {
    687     RT_NOREF(pUVM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
     699static DECLCALLBACK(int) dbgDiggerOS2StackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu,
     700                                                       PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx,
     701                                                       RTDBGAS hAs, uint64_t *puScratch)
     702{
     703    RT_NOREF(pUVM, pVMM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
    688704    return VINF_SUCCESS;
    689705}
     
    693709 * @copydoc DBGFOSREG::pfnQueryInterface
    694710 */
    695 static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    696 {
    697     RT_NOREF3(pUVM, pvData, enmIf);
     711static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf)
     712{
     713    RT_NOREF(pUVM, pVMM, pvData, enmIf);
    698714    return NULL;
    699715}
     
    703719 * @copydoc DBGFOSREG::pfnQueryVersion
    704720 */
    705 static DECLCALLBACK(int)  dbgDiggerOS2QueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
    706 {
    707     RT_NOREF1(pUVM);
     721static DECLCALLBACK(int)  dbgDiggerOS2QueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData,
     722                                                   char *pszVersion, size_t cchVersion)
     723{
    708724    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     725    RT_NOREF(pUVM, pVMM);
    709726    Assert(pThis->fValid);
     727
    710728    char *achOS2ProductType[32];
    711729    char *pszOS2ProductType = (char *)achOS2ProductType;
     
    748766 * @copydoc DBGFOSREG::pfnTerm
    749767 */
    750 static DECLCALLBACK(void)  dbgDiggerOS2Term(PUVM pUVM, void *pvData)
    751 {
    752     RT_NOREF1(pUVM);
     768static DECLCALLBACK(void)  dbgDiggerOS2Term(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     769{
    753770    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
    754771    Assert(pThis->fValid);
    755772
    756     DBGFR3InfoDeregisterExternal(pUVM, "sas");
    757     DBGFR3InfoDeregisterExternal(pUVM, "gis");
    758     DBGFR3InfoDeregisterExternal(pUVM, "lis");
    759     DBGFR3InfoDeregisterExternal(pUVM, "panic");
     773    pVMM->pfnDBGFR3InfoDeregisterExternal(pUVM, "sas");
     774    pVMM->pfnDBGFR3InfoDeregisterExternal(pUVM, "gis");
     775    pVMM->pfnDBGFR3InfoDeregisterExternal(pUVM, "lis");
     776    pVMM->pfnDBGFR3InfoDeregisterExternal(pUVM, "panic");
    760777
    761778    pThis->fValid = false;
     
    766783 * @copydoc DBGFOSREG::pfnRefresh
    767784 */
    768 static DECLCALLBACK(int)  dbgDiggerOS2Refresh(PUVM pUVM, void *pvData)
     785static DECLCALLBACK(int)  dbgDiggerOS2Refresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    769786{
    770787    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     
    775792     * For now we'll flush and reload everything.
    776793     */
    777     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     794    RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    778795    if (hDbgAs != NIL_RTDBGAS)
    779796    {
     
    795812    }
    796813
    797     dbgDiggerOS2Term(pUVM, pvData);
    798     return dbgDiggerOS2Init(pUVM, pvData);
     814    dbgDiggerOS2Term(pUVM, pVMM, pvData);
     815    return dbgDiggerOS2Init(pUVM, pVMM, pvData);
    799816}
    800817
     
    847864
    848865
    849 static void dbgdiggerOS2ProcessModule(PUVM pUVM, PDBGDIGGEROS2 pThis, DBGDIGGEROS2BUF *pBuf,
     866static void dbgdiggerOS2ProcessModule(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGEROS2 pThis, DBGDIGGEROS2BUF *pBuf,
    850867                                      const char *pszCacheSubDir, RTDBGAS hAs, RTDBGCFG hDbgCfg)
    851868{
     
    877894     */
    878895    DBGFADDRESS     Addr;
    879     int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte.mte_swapmte), &pBuf->smte, sizeof(pBuf->smte));
     896    int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, Mte.mte_swapmte),
     897                                    &pBuf->smte, sizeof(pBuf->smte));
    880898    if (RT_FAILURE(rc))
    881899    {
     
    900918    {
    901919        uint32_t cbToRead = RT_MIN(SwapMte.smte_path, sizeof(szModPath) - 1);
    902         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, SwapMte.smte_path), szModPath, cbToRead);
     920        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SwapMte.smte_path),
     921                                    szModPath, cbToRead);
    903922        szModPath[cbToRead] = '\0';
    904923    }
     
    922941     * Read the object table into the buffer.
    923942     */
    924     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, SwapMte.smte_objtab),
    925                        &pBuf->aOtes[0], sizeof(pBuf->aOtes[0]) * SwapMte.smte_objcnt);
     943    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SwapMte.smte_objtab),
     944                                &pBuf->aOtes[0], sizeof(pBuf->aOtes[0]) * SwapMte.smte_objcnt);
    926945    if (RT_FAILURE(rc))
    927946    {
     
    10361055 * @copydoc DBGFOSREG::pfnInit
    10371056 */
    1038 static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, void *pvData)
     1057static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    10391058{
    10401059    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     
    10491068     */
    10501069    /* Version info is at GIS:15h (major/minor/revision). */
    1051     rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGis, 0x15);
     1070    rc = pVMM->pfnDBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGis, 0x15);
    10521071    if (RT_FAILURE(rc))
    10531072        return VERR_NOT_SUPPORTED;
    1054     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, uBuf.au32, sizeof(uint32_t));
     1073    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, uBuf.au32, sizeof(uint32_t));
    10551074    if (RT_FAILURE(rc))
    10561075        return VERR_NOT_SUPPORTED;
     
    10641083     * Try use SAS to find the module list.
    10651084     */
    1066     rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
     1085    rc = pVMM->pfnDBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
    10671086    if (RT_SUCCESS(rc))
    10681087    {
    1069         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &uBuf.sas, sizeof(uBuf.sas));
     1088        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &uBuf.sas, sizeof(uBuf.sas));
    10701089        if (RT_SUCCESS(rc))
    10711090        {
    1072             rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, uBuf.sas.SAS_vm_data);
     1091            rc = pVMM->pfnDBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, uBuf.sas.SAS_vm_data);
    10731092            if (RT_SUCCESS(rc))
    1074                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &uBuf.sasvm, sizeof(uBuf.sasvm));
     1093                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &uBuf.sasvm, sizeof(uBuf.sasvm));
    10751094            if (RT_SUCCESS(rc))
    10761095            {
     
    10781097                 * Work the module list.
    10791098                 */
    1080                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, uBuf.sasvm.SAS_vm_all_mte),
    1081                                    &uBuf.au32[0], sizeof(uBuf.au32[0]));
     1099                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uBuf.sasvm.SAS_vm_all_mte),
     1100                                            &uBuf.au32[0], sizeof(uBuf.au32[0]));
    10821101                if (RT_SUCCESS(rc))
    10831102                {
    10841103                    uint32_t uOs2Krnl = UINT32_MAX;
    1085                     RTDBGCFG hDbgCfg  = DBGFR3AsGetConfig(pUVM); /* (don't release this) */
    1086                     RTDBGAS  hAs      = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_GLOBAL);
     1104                    RTDBGCFG hDbgCfg  = pVMM->pfnDBGFR3AsGetConfig(pUVM); /* (don't release this) */
     1105                    RTDBGAS  hAs      = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_GLOBAL);
    10871106
    10881107                    char szCacheSubDir[24];
    10891108                    RTStrPrintf(szCacheSubDir, sizeof(szCacheSubDir), "os2-%u.%u", pThis->OS2MajorVersion, pThis->OS2MinorVersion);
    10901109
    1091                     DBGFR3AddrFromFlat(pUVM, &Addr, uBuf.au32[0]);
     1110                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uBuf.au32[0]);
    10921111                    while (Addr.FlatPtr != 0 && Addr.FlatPtr != UINT32_MAX)
    10931112                    {
    1094                         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &uBuf.mte, sizeof(uBuf.mte));
     1113                        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &uBuf.mte, sizeof(uBuf.mte));
    10951114                        if (RT_FAILURE(rc))
    10961115                            break;
     
    11001119                            uOs2Krnl = (uint32_t)Addr.FlatPtr;
    11011120
    1102                         DBGFR3AddrFromFlat(pUVM, &Addr, uBuf.mte.mte_link);
    1103                         dbgdiggerOS2ProcessModule(pUVM, pThis, &uBuf, szCacheSubDir, hAs, hDbgCfg);
     1121                        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uBuf.mte.mte_link);
     1122                        dbgdiggerOS2ProcessModule(pUVM, pVMM, pThis, &uBuf, szCacheSubDir, hAs, hDbgCfg);
    11041123                    }
    11051124
     
    11081127                    if (uOs2Krnl != UINT32_MAX)
    11091128                    {
    1110                         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, uOs2Krnl),
    1111                                            &uBuf.mte, sizeof(uBuf.mte));
     1129                        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uOs2Krnl),
     1130                                                    &uBuf.mte, sizeof(uBuf.mte));
    11121131                        if (RT_SUCCESS(rc))
    11131132                        {
    11141133                            LogRel(("DbgDiggerOs2: Module @ %#010RX32: %.8s %#x %#x [again]\n", (uint32_t)Addr.FlatPtr,
    11151134                                    uBuf.mte.mte_modname, uBuf.mte.mte_flags1, uBuf.mte.mte_flags2));
    1116                             dbgdiggerOS2ProcessModule(pUVM, pThis, &uBuf, szCacheSubDir, hAs, hDbgCfg);
     1135                            dbgdiggerOS2ProcessModule(pUVM, pVMM, pThis, &uBuf, szCacheSubDir, hAs, hDbgCfg);
    11171136                        }
    11181137                    }
     
    11271146     * Register info handlers.
    11281147     */
    1129     DBGFR3InfoRegisterExternal(pUVM, "sas",   "Dumps the OS/2 system anchor block (SAS).", dbgDiggerOS2InfoSas, pThis);
    1130     DBGFR3InfoRegisterExternal(pUVM, "gis",   "Dumps the OS/2 global info segment (GIS).", dbgDiggerOS2InfoGis, pThis);
    1131     DBGFR3InfoRegisterExternal(pUVM, "lis",   "Dumps the OS/2 local info segment (current process).", dbgDiggerOS2InfoLis, pThis);
    1132     DBGFR3InfoRegisterExternal(pUVM, "panic", "Dumps the OS/2 system panic message.",      dbgDiggerOS2InfoPanic, pThis);
     1148    pVMM->pfnDBGFR3InfoRegisterExternal(pUVM, "sas",   "Dumps the OS/2 system anchor block (SAS).", dbgDiggerOS2InfoSas, pThis);
     1149    pVMM->pfnDBGFR3InfoRegisterExternal(pUVM, "gis",   "Dumps the OS/2 global info segment (GIS).", dbgDiggerOS2InfoGis, pThis);
     1150    pVMM->pfnDBGFR3InfoRegisterExternal(pUVM, "lis",   "Dumps the OS/2 local info segment (current process).", dbgDiggerOS2InfoLis, pThis);
     1151    pVMM->pfnDBGFR3InfoRegisterExternal(pUVM, "panic", "Dumps the OS/2 system panic message.",      dbgDiggerOS2InfoPanic, pThis);
    11331152
    11341153    return VINF_SUCCESS;
     
    11391158 * @copydoc DBGFOSREG::pfnProbe
    11401159 */
    1141 static DECLCALLBACK(bool)  dbgDiggerOS2Probe(PUVM pUVM, void *pvData)
     1160static DECLCALLBACK(bool)  dbgDiggerOS2Probe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    11421161{
    11431162    PDBGDIGGEROS2   pThis = (PDBGDIGGEROS2)pvData;
     
    11541173
    11551174    /*
    1156      * If the DWORD at 70:0 contains 'SAS ' it's quite unlikely that this wouldn't be OS/2.
     1175     * If the DWORD at 70:0 is 'SAS ' it's quite unlikely that this wouldn't be OS/2.
    11571176     * Note: The SAS layout is similar between 16-bit and 32-bit OS/2, but not identical.
    11581177     * 32-bit OS/2 will have the flat kernel data selector at SAS:06. The selector is 168h
     
    11621181     */
    11631182    do {
    1164         rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
     1183        rc = pVMM->pfnDBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
    11651184        if (RT_FAILURE(rc))
    11661185            break;
    1167         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256);
     1186        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256);
    11681187        if (RT_FAILURE(rc))
    11691188            break;
     
    12001219 * @copydoc DBGFOSREG::pfnDestruct
    12011220 */
    1202 static DECLCALLBACK(void)  dbgDiggerOS2Destruct(PUVM pUVM, void *pvData)
    1203 {
    1204     RT_NOREF2(pUVM, pvData);
     1221static DECLCALLBACK(void)  dbgDiggerOS2Destruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1222{
     1223    RT_NOREF(pUVM, pVMM, pvData);
    12051224}
    12061225
     
    12091228 * @copydoc DBGFOSREG::pfnConstruct
    12101229 */
    1211 static DECLCALLBACK(int)  dbgDiggerOS2Construct(PUVM pUVM, void *pvData)
    1212 {
    1213     RT_NOREF1(pUVM);
     1230static DECLCALLBACK(int)  dbgDiggerOS2Construct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1231{
    12141232    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
    12151233    pThis->fValid = false;
     
    12171235    pThis->enmVer = DBGDIGGEROS2VER_UNKNOWN;
    12181236    pThis->pUVM   = pUVM;
     1237    pThis->pVMM   = pVMM;
    12191238    return VINF_SUCCESS;
    12201239}
  • trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp

    r93115 r93470  
    2424#include "DBGPlugInCommonELF.h"
    2525#include <VBox/vmm/dbgf.h>
     26#include <VBox/vmm/vmmr3vtable.h>
    2627#include <iprt/asm.h>
    2728#include <iprt/err.h>
     
    351352*   Internal Functions                                                                                                           *
    352353*********************************************************************************************************************************/
    353 static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, void *pvData);
     354static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData);
    354355
    355356
     
    358359 * @copydoc DBGFOSREG::pfnStackUnwindAssist
    359360 */
    360 static DECLCALLBACK(int) dbgDiggerSolarisStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,
    361                                                            PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,
    362                                                            uint64_t *puScratch)
    363 {
    364     RT_NOREF(pUVM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
     361static DECLCALLBACK(int) dbgDiggerSolarisStackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu,
     362                                                           PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState,
     363                                                           PCCPUMCTX pInitialCtx, RTDBGAS hAs, uint64_t *puScratch)
     364{
     365    RT_NOREF(pUVM, pVMM, pvData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);
    365366    return VINF_SUCCESS;
    366367}
     
    370371 * @copydoc DBGFOSREG::pfnQueryInterface
    371372 */
    372 static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    373 {
    374     RT_NOREF3(pUVM, pvData, enmIf);
     373static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf)
     374{
     375    RT_NOREF(pUVM, pVMM, pvData, enmIf);
    375376    return NULL;
    376377}
     
    380381 * @copydoc DBGFOSREG::pfnQueryVersion
    381382 */
    382 static DECLCALLBACK(int)  dbgDiggerSolarisQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
     383static DECLCALLBACK(int)  dbgDiggerSolarisQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData,
     384                                                       char *pszVersion, size_t cchVersion)
    383385{
    384386    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    392394    DBGFADDRESS Addr;
    393395    RTDBGSYMBOL SymUtsName;
    394     int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);
     396    int rc = pVMM->pfnDBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);
    395397    if (RT_SUCCESS(rc))
    396         rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName));
     398        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, SymUtsName.Value),
     399                                    &UtsName, sizeof(UtsName));
    397400    if (RT_FAILURE(rc))
    398401    {
     
    402405        memset(&UtsName, '\0', sizeof(UtsName));
    403406        strcpy(&UtsName.sysname[0], "SunOS");
    404         rc = DBGFR3MemScan(pUVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,
    405                            &UtsName.sysname[0], sizeof(UtsName.sysname), &Addr);
     407        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,
     408                                    &UtsName.sysname[0], sizeof(UtsName.sysname), &Addr);
    406409        if (RT_SUCCESS(rc))
    407             rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Addr.FlatPtr - RT_OFFSETOF(SOL_utsname_t, sysname)),
    408                                &UtsName, sizeof(UtsName));
     410            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr,
     411                                                                             Addr.FlatPtr - RT_OFFSETOF(SOL_utsname_t, sysname)),
     412                                        &UtsName, sizeof(UtsName));
    409413    }
    410414
     
    442446 * @param   pModCtl Pointer to the modctl structure.
    443447 */
    444 static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
     448static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
    445449{
    446450    RT_NOREF1(pThis);
     
    461465    char szModName[64];
    462466    DBGFADDRESS Addr;
    463     int rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_modname), szModName, sizeof(szModName));
     467    int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_modname),
     468                                          szModName, sizeof(szModName));
    464469    if (RT_FAILURE(rc))
    465470        return;
     
    469474    AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_filename, v9_32.mod_filename);
    470475    char szFilename[256];
    471     rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_filename), szFilename, sizeof(szFilename));
     476    rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_filename),
     477                                      szFilename, sizeof(szFilename));
    472478    if (RT_FAILURE(rc))
    473479        strcpy(szFilename, szModName);
     
    480486    AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_mp, v9_32.mod_mp);
    481487    struct SOL32_module Module;
    482     rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_mp), &Module, sizeof(Module));
     488    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_mp), &Module, sizeof(Module));
    483489    if (RT_FAILURE(rc))
    484490        return;
     
    550556    if (!paShdrs)
    551557        return;
    552     rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
     558    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
    553559    if (RT_SUCCESS(rc))
    554560    {
     
    556562        if (pvSymSpace)
    557563        {
    558             rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
     564            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace),
     565                                        pvSymSpace, Module.symsize);
    559566            if (RT_SUCCESS(rc))
    560567            {
     
    571578                cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms);
    572579
    573                 DBGDiggerCommonParseElf32Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
     580                DBGDiggerCommonParseElf32Mod(pUVM, pVMM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
    574581                                             &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings,
    575582                                             SOL32_MIN_KRNL_ADDR, SOL32_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG);
     
    591598 * @param   pModCtl Pointer to the modctl structure.
    592599 */
    593 static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
     600static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
    594601{
    595602    RT_NOREF1(pThis);
     
    610617    char szModName[64];
    611618    DBGFADDRESS Addr;
    612     int rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_modname), szModName, sizeof(szModName));
     619    int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_modname),
     620                                          szModName, sizeof(szModName));
    613621    if (RT_FAILURE(rc))
    614622        return;
     
    618626    AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_filename, v9_64.mod_filename);
    619627    char szFilename[256];
    620     rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_filename), szFilename, sizeof(szFilename));
     628    rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_filename),
     629                                      szFilename, sizeof(szFilename));
    621630    if (RT_FAILURE(rc))
    622631        strcpy(szFilename, szModName);
     
    629638    AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_mp, v9_64.mod_mp);
    630639    struct SOL64_module Module;
    631     rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_mp), &Module, sizeof(Module));
     640    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_mp), &Module, sizeof(Module));
    632641    if (RT_FAILURE(rc))
    633642        return;
     
    698707    if (!paShdrs)
    699708        return;
    700     rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
     709    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
    701710    if (RT_SUCCESS(rc))
    702711    {
     
    704713        if (pvSymSpace)
    705714        {
    706             rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
     715            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace),
     716                                        pvSymSpace, Module.symsize);
    707717            if (RT_SUCCESS(rc))
    708718            {
     
    719729                cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms);
    720730
    721                 DBGDiggerCommonParseElf64Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
     731                DBGDiggerCommonParseElf64Mod(pUVM, pVMM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
    722732                                             &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings,
    723733                                             SOL64_MIN_KRNL_ADDR, SOL64_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG);
     
    735745 * @copydoc DBGFOSREG::pfnTerm
    736746 */
    737 static DECLCALLBACK(void)  dbgDiggerSolarisTerm(PUVM pUVM, void *pvData)
    738 {
    739     RT_NOREF1(pUVM);
     747static DECLCALLBACK(void)  dbgDiggerSolarisTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     748{
    740749    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     750    RT_NOREF(pUVM, pVMM);
    741751    Assert(pThis->fValid);
    742752
     
    748758 * @copydoc DBGFOSREG::pfnRefresh
    749759 */
    750 static DECLCALLBACK(int)  dbgDiggerSolarisRefresh(PUVM pUVM, void *pvData)
     760static DECLCALLBACK(int)  dbgDiggerSolarisRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    751761{
    752762    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
    753     NOREF(pThis);
     763    RT_NOREF(pThis);
    754764    Assert(pThis->fValid);
    755765
     
    757767     * For now we'll flush and reload everything.
    758768     */
    759     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     769    RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    760770    if (hDbgAs != NIL_RTDBGAS)
    761771    {
     
    777787    }
    778788
    779     dbgDiggerSolarisTerm(pUVM, pvData);
    780     return dbgDiggerSolarisInit(pUVM, pvData);
     789    dbgDiggerSolarisTerm(pUVM, pVMM, pvData);
     790    return dbgDiggerSolarisInit(pUVM, pVMM, pvData);
    781791}
    782792
     
    785795 * @copydoc DBGFOSREG::pfnInit
    786796 */
    787 static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, void *pvData)
     797static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    788798{
    789799    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    795805     * On Solaris the kernel and is the global address space.
    796806     */
    797     DBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);
     807    pVMM->pfnDBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);
    798808
    799809/** @todo Use debug_info, build 7x / S10U6. */
     
    803813     * We know it resides in the unix data segment.
    804814     */
    805     DBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0);
     815    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0);
    806816
    807817    DBGFADDRESS     CurAddr = pThis->AddrUnixData;
    808818    DBGFADDRESS     MaxAddr;
    809     DBGFR3AddrFromFlat(pUVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);
     819    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);
    810820    const uint8_t  *pbExpr = (const uint8_t *)&pThis->AddrUnixText.FlatPtr;
    811821    const uint32_t  cbExpr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t);
     
    814824    {
    815825        DBGFADDRESS HitAddr;
    816         rc = DBGFR3MemScan(pUVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);
     826        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);
    817827        if (RT_FAILURE(rc))
    818828            break;
     
    826836        if (pThis->f64Bit)
    827837        {
    828             DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
     838            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
    829839            SOL64v11_modctl_t ModCtlv11;
    830             rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
     840            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
    831841            if (RT_SUCCESS(rc))
    832842            {
     
    848858                    char szUnix[5];
    849859                    DBGFADDRESS NameAddr;
    850                     DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
    851                     rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     860                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
     861                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    852862                    if (RT_SUCCESS(rc))
    853863                    {
     
    866876        else
    867877        {
    868             DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
     878            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
    869879            SOL32v11_modctl_t ModCtlv11;
    870             rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
     880            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
    871881            if (RT_SUCCESS(rc))
    872882            {
     
    888898                    char szUnix[5];
    889899                    DBGFADDRESS NameAddr;
    890                     DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
    891                     rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     900                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
     901                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    892902                    if (RT_SUCCESS(rc))
    893903                    {
     
    908918        if (pThis->f64Bit)
    909919        {
    910             DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));
     920            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));
    911921            SOL64v9_modctl_t ModCtlv9;
    912             rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
     922            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
    913923            if (RT_SUCCESS(rc))
    914924            {
     
    928938                    char szUnix[5];
    929939                    DBGFADDRESS NameAddr;
    930                     DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
    931                     rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     940                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
     941                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    932942                    if (RT_SUCCESS(rc))
    933943                    {
     
    946956        else
    947957        {
    948             DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));
     958            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));
    949959            SOL32v9_modctl_t ModCtlv9;
    950             rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
     960            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
    951961            if (RT_SUCCESS(rc))
    952962            {
     
    966976                    char szUnix[5];
    967977                    DBGFADDRESS NameAddr;
    968                     DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
    969                     rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     978                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
     979                    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    970980                    if (RT_SUCCESS(rc))
    971981                    {
     
    984994
    985995        /* next */
    986         DBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr);
     996        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr);
    987997    }
    988998
     
    9981008            /* read it */
    9991009            SOL_modctl_t ModCtl;
    1000             rc = DBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl);
     1010            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl);
    10011011            if (RT_FAILURE(rc))
    10021012            {
     
    10071017            /* process it. */
    10081018            if (pThis->f64Bit)
    1009                 dbgDiggerSolarisProcessModCtl64(pUVM, pThis, &ModCtl);
     1019                dbgDiggerSolarisProcessModCtl64(pUVM, pVMM, pThis, &ModCtl);
    10101020            else
    1011                 dbgDiggerSolarisProcessModCtl32(pUVM, pThis, &ModCtl);
     1021                dbgDiggerSolarisProcessModCtl32(pUVM, pVMM, pThis, &ModCtl);
    10121022
    10131023            /* next */
     
    10201030                    break;
    10211031                }
    1022                 DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next);
     1032                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next);
    10231033            }
    10241034            else
     
    10301040                    break;
    10311041                }
    1032                 DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next);
     1042                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next);
    10331043            }
    10341044            if (++iMod >= 1024)
     
    10481058 * @copydoc DBGFOSREG::pfnProbe
    10491059 */
    1050 static DECLCALLBACK(bool)  dbgDiggerSolarisProbe(PUVM pUVM, void *pvData)
     1060static DECLCALLBACK(bool)  dbgDiggerSolarisProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    10511061{
    10521062    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    10591069
    10601070    /* 32-bit search range. */
    1061     DBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000);
     1071    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000);
    10621072    RTGCUINTPTR cbRange = 0xfec00000 - 0xfe800000;
    10631073
    10641074    DBGFADDRESS HitAddr;
    10651075    static const uint8_t s_abSunRelease[] = "SunOS Release ";
    1066     int rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
     1076    int rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
    10671077    if (RT_FAILURE(rc))
    10681078    {
    10691079        /* 64-bit.... */
    1070         DBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000));
     1080        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000));
    10711081        cbRange = UINT64_C(0xfffffffffbd00000) - UINT64_C(0xfffffffffb800000);
    1072         rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
     1082        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
    10731083        if (RT_FAILURE(rc))
    10741084            return false;
     
    10811091    static const uint8_t s_abSMI[] = "Sun Microsystems, Inc.";
    10821092    static const uint8_t s_abORCL[] = "Oracle and/or its affiliates.";
    1083     rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSMI, sizeof(s_abSMI) - 1, &HitAddr);
     1093    rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSMI, sizeof(s_abSMI) - 1, &HitAddr);
    10841094    if (RT_FAILURE(rc))
    10851095    {
    10861096        /* Try the alternate copyright string. */
    1087         rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abORCL, sizeof(s_abORCL) - 1, &HitAddr);
     1097        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abORCL, sizeof(s_abORCL) - 1, &HitAddr);
    10881098        if (RT_FAILURE(rc))
    10891099            return false;
     
    10941104     */
    10951105    pThis->AddrUnixText = Addr;
    1096     DBGFR3AddrAdd(&Addr, SOL_UNIX_MAX_CODE_SEG_SIZE);
     1106    pVMM->pfnDBGFR3AddrAdd(&Addr, SOL_UNIX_MAX_CODE_SEG_SIZE);
    10971107    pThis->AddrUnixData = Addr;
    10981108    pThis->f64Bit       = f64Bit;
     
    11051115 * @copydoc DBGFOSREG::pfnDestruct
    11061116 */
    1107 static DECLCALLBACK(void)  dbgDiggerSolarisDestruct(PUVM pUVM, void *pvData)
    1108 {
    1109     RT_NOREF2(pUVM, pvData);
    1110 
     1117static DECLCALLBACK(void)  dbgDiggerSolarisDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1118{
     1119    RT_NOREF(pUVM, pVMM, pvData);
    11111120}
    11121121
     
    11151124 * @copydoc DBGFOSREG::pfnConstruct
    11161125 */
    1117 static DECLCALLBACK(int)  dbgDiggerSolarisConstruct(PUVM pUVM, void *pvData)
    1118 {
    1119     RT_NOREF2(pUVM, pvData);
     1126static DECLCALLBACK(int)  dbgDiggerSolarisConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1127{
     1128    RT_NOREF(pUVM, pVMM, pvData);
    11201129    return VINF_SUCCESS;
    11211130}
  • trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp

    r93115 r93470  
    2525#include <VBox/vmm/cpumctx.h>
    2626#include <VBox/vmm/mm.h>
     27#include <VBox/vmm/vmmr3vtable.h>
    2728#include <VBox/err.h>
    2829#include <VBox/param.h>
     
    321322*   Internal Functions                                                                                                           *
    322323*********************************************************************************************************************************/
    323 static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, void *pvData);
     324static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData);
    324325
    325326
     
    341342 * @param   pThis           The instance data.
    342343 * @param   pUVM            The user mode VM handle.
    343  */
    344 static void dbgDiggerWinNtResolveKpcr(PDBGDIGGERWINNT pThis, PUVM pUVM)
     344 * @param   pVMM            The VMM function table.
     345 */
     346static void dbgDiggerWinNtResolveKpcr(PDBGDIGGERWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM)
    345347{
    346348    /*
     
    352354     * match what we expect.
    353355     */
    354     VMCPUID cCpus = DBGFR3CpuGetCount(pUVM);
     356    VMCPUID cCpus = pVMM->pfnDBGFR3CpuGetCount(pUVM);
    355357    pThis->paKpcrAddr = (PDBGFADDRESS)RTMemAllocZ(cCpus * 2 * sizeof(DBGFADDRESS));
    356358    if (RT_LIKELY(pThis->paKpcrAddr))
     
    370372                uint32_t GCPtrKpcrBase = 0;
    371373
    372                 rc = DBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_FS_BASE, &GCPtrKpcrBase);
     374                rc = pVMM->pfnDBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_FS_BASE, &GCPtrKpcrBase);
    373375                if (   RT_SUCCESS(rc)
    374376                    && WINNT32_VALID_ADDRESS(GCPtrKpcrBase))
     
    394396
    395397                    LogFlow(("DigWinNt/KPCR[%u]: GS Base %RGv\n", idCpu, GCPtrKpcrBase));
    396                     DBGFR3AddrFromFlat(pUVM, pKpcrAddr, GCPtrKpcrBase);
    397 
    398                     rc = DBGFR3MemRead(pUVM, idCpu, pKpcrAddr, &Kpcr, sizeof(Kpcr));
     398                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, pKpcrAddr, GCPtrKpcrBase);
     399
     400                    rc = pVMM->pfnDBGFR3MemRead(pUVM, idCpu, pKpcrAddr, &Kpcr, sizeof(Kpcr));
    399401                    if (RT_SUCCESS(rc))
    400402                    {
     
    402404                        uint32_t GCPtrIdt = 0;
    403405
    404                         rc = DBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_GDTR_BASE, &GCPtrGdt);
     406                        rc = pVMM->pfnDBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_GDTR_BASE, &GCPtrGdt);
    405407                        if (RT_SUCCESS(rc))
    406                             rc = DBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_IDTR_BASE, &GCPtrIdt);
     408                            rc = pVMM->pfnDBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_IDTR_BASE, &GCPtrIdt);
    407409                        if (RT_SUCCESS(rc))
    408410                        {
     
    411413                                && Kpcr.GCPtrSelf == pKpcrAddr->FlatPtr)
    412414                            {
    413                                 DBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb);
     415                                pVMM->pfnDBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb);
    414416                                LogRel(("DigWinNt/KPCR[%u]: KPCR=%RGv KPCRB=%RGv\n", idCpu, pKpcrAddr->FlatPtr, pKpcrbAddr->FlatPtr));
    415417
     
    428430                                    DBGFADDRESS AddrKdVersBlock;
    429431
    430                                     DBGFR3AddrFromFlat(pUVM, &AddrKdVersBlock, Kpcr.GCPtrKdVersionBlock);
    431                                     rc = DBGFR3MemRead(pUVM, idCpu, &AddrKdVersBlock, &KdVersBlock, sizeof(KdVersBlock));
     432                                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrKdVersBlock, Kpcr.GCPtrKdVersionBlock);
     433                                    rc = pVMM->pfnDBGFR3MemRead(pUVM, idCpu, &AddrKdVersBlock, &KdVersBlock, sizeof(KdVersBlock));
    432434                                    if (RT_SUCCESS(rc))
    433435                                        pThis->NtBuildNumber = KdVersBlock.MinorVersion;
     
    449451                /* Read GS base which points to the base of the KPCR for each CPU. */
    450452                RTGCUINTPTR GCPtrTmp = 0;
    451                 rc = DBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_GS_BASE, &GCPtrTmp);
     453                rc = pVMM->pfnDBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_GS_BASE, &GCPtrTmp);
    452454                if (   RT_SUCCESS(rc)
    453455                    && !WINNT64_VALID_ADDRESS(GCPtrTmp))
     
    457459                     * read the GS kernel base MSR instead.
    458460                     */
    459                     rc = DBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_MSR_K8_KERNEL_GS_BASE, &GCPtrTmp);
     461                    rc = pVMM->pfnDBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_MSR_K8_KERNEL_GS_BASE, &GCPtrTmp);
    460462                }
    461463
     
    464466                {
    465467                    LogFlow(("DigWinNt/KPCR[%u]: GS Base %RGv\n", idCpu, GCPtrTmp));
    466                     DBGFR3AddrFromFlat(pUVM, pKpcrAddr, GCPtrTmp);
    467 
    468                     rc = DBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_GDTR_BASE, &GCPtrTmp);
     468                    pVMM->pfnDBGFR3AddrFromFlat(pUVM, pKpcrAddr, GCPtrTmp);
     469
     470                    rc = pVMM->pfnDBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_GDTR_BASE, &GCPtrTmp);
    469471                    if (RT_SUCCESS(rc))
    470472                    {
     
    482484                        } Kpcr;
    483485
    484                         rc = DBGFR3MemRead(pUVM, idCpu, pKpcrAddr, &Kpcr, sizeof(Kpcr));
     486                        rc = pVMM->pfnDBGFR3MemRead(pUVM, idCpu, pKpcrAddr, &Kpcr, sizeof(Kpcr));
    485487                        if (RT_SUCCESS(rc))
    486488                        {
     
    489491                                /** @todo && TSS */ )
    490492                            {
    491                                 DBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb);
     493                                pVMM->pfnDBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb);
    492494                                LogRel(("DigWinNt/KPCR[%u]: KPCR=%RGv KPCRB=%RGv\n", idCpu, pKpcrAddr->FlatPtr, pKpcrbAddr->FlatPtr));
    493495                            }
     
    525527 * @param   pThis           The instance data.
    526528 * @param   pUVM            The user mode VM handle.
     529 * @param   pVMM            The VMM function table.
    527530 * @param   pszName         The module name.
    528531 * @param   pszFilename     The image filename.
     
    530533 * @param   cbImage         The size of the image.
    531534 */
    532 static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, const char *pszName, const char *pszFilename,
    533                                        PCDBGFADDRESS pImageAddr, uint32_t cbImage)
     535static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszName,
     536                                       const char *pszFilename, PCDBGFADDRESS pImageAddr, uint32_t cbImage)
    534537{
    535538    LogFlow(("DigWinNt: %RGp %#x %s\n", pImageAddr->FlatPtr, cbImage, pszName));
     
    550553    RTERRINFOSTATIC ErrInfo;
    551554    RTDBGMOD        hDbgMod = NIL_RTDBGMOD;
    552     int rc = DBGFR3ModInMem(pUVM, pImageAddr, pThis->fNt31 ? DBGFMODINMEM_F_PE_NT31 : 0, pszName, pszFilename,
    553                             pThis->f32Bit ? RTLDRARCH_X86_32 : RTLDRARCH_AMD64, cbImage,
    554                             &hDbgMod, RTErrInfoInitStatic(&ErrInfo));
     555    int rc = pVMM->pfnDBGFR3ModInMem(pUVM, pImageAddr, pThis->fNt31 ? DBGFMODINMEM_F_PE_NT31 : 0, pszName, pszFilename,
     556                                     pThis->f32Bit ? RTLDRARCH_X86_32 : RTLDRARCH_AMD64, cbImage,
     557                                     &hDbgMod, RTErrInfoInitStatic(&ErrInfo));
    555558    if (RT_SUCCESS(rc))
    556559    {
     
    564567         * Link the module.
    565568         */
    566         RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     569        RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    567570        if (hAs != NIL_RTDBGAS)
    568571            rc = RTDbgAsModuleLink(hAs, hDbgMod, pImageAddr->FlatPtr, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/);
     
    627630 * @interface_method_impl{DBGFOSIWINNT,pfnQueryVersion}
    628631 */
    629 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryVersion(struct DBGFOSIWINNT *pThis, PUVM pUVM,
     632static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryVersion(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
    630633                                                           uint32_t *puVersMajor, uint32_t *puVersMinor,
    631634                                                           uint32_t *puBuildNumber, bool *pf32Bit)
    632635{
    633     RT_NOREF(pUVM);
    634636    PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt);
     637    RT_NOREF(pUVM, pVMM);
    635638
    636639    if (puVersMajor)
     
    649652 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKernelPtrs}
    650653 */
    651 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKernelPtrs(struct DBGFOSIWINNT *pThis, PUVM pUVM,
     654static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKernelPtrs(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
    652655                                                              PRTGCUINTPTR pGCPtrKernBase, PRTGCUINTPTR pGCPtrPsLoadedModuleList)
    653656{
    654     RT_NOREF(pUVM);
    655657    PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt);
     658    RT_NOREF(pUVM, pVMM);
    656659
    657660    *pGCPtrKernBase           = pData->KernelAddr.FlatPtr;
     
    664667 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKpcrForVCpu}
    665668 */
    666 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,
    667                                                                PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb)
     669static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     670                                                               VMCPUID idCpu, PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb)
    668671{
    669672    PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt);
     
    672675        return VERR_NOT_SUPPORTED;
    673676
    674     AssertReturn(idCpu < DBGFR3CpuGetCount(pUVM), VERR_INVALID_PARAMETER);
     677    AssertReturn(idCpu < pVMM->pfnDBGFR3CpuGetCount(pUVM), VERR_INVALID_CPU_ID);
    675678
    676679    if (pKpcr)
     
    685688 * @interface_method_impl{DBGFOSIWINNT,pfnQueryCurThrdForVCpu}
    686689 */
    687 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,
    688                                                                   PRTGCUINTPTR pCurThrd)
     690static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     691                                                                  VMCPUID idCpu, PRTGCUINTPTR pCurThrd)
    689692{
    690693    PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt);
     
    693696        return VERR_NOT_SUPPORTED;
    694697
    695     AssertReturn(idCpu < DBGFR3CpuGetCount(pUVM), VERR_INVALID_PARAMETER);
     698    AssertReturn(idCpu < pVMM->pfnDBGFR3CpuGetCount(pUVM), VERR_INVALID_CPU_ID);
    696699
    697700    DBGFADDRESS AddrCurThrdPtr = pData->paKpcrbAddr[idCpu];
    698     DBGFR3AddrAdd(&AddrCurThrdPtr, 0x08); /** @todo Make this prettier. */
    699     return DBGFR3MemRead(pUVM, idCpu, &AddrCurThrdPtr, pCurThrd, sizeof(*pCurThrd));
     701    pVMM->pfnDBGFR3AddrAdd(&AddrCurThrdPtr, 0x08); /** @todo Make this prettier. */
     702    return pVMM->pfnDBGFR3MemRead(pUVM, idCpu, &AddrCurThrdPtr, pCurThrd, sizeof(*pCurThrd));
    700703}
    701704
     
    704707 * @copydoc DBGFOSREG::pfnStackUnwindAssist
    705708 */
    706 static DECLCALLBACK(int) dbgDiggerWinNtStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,
    707                                                          PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,
    708                                                          uint64_t *puScratch)
     709static DECLCALLBACK(int) dbgDiggerWinNtStackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu,
     710                                                         PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx,
     711                                                         RTDBGAS hAs, uint64_t *puScratch)
    709712{
    710713    Assert(pInitialCtx);
     
    816819                        /* Resize the array, zeroing the extension. */
    817820                        if (pFrame->cSureRegs)
    818                             paSureRegs = (PDBGFREGVALEX)MMR3HeapRealloc(pFrame->paSureRegs, iReg * sizeof(paSureRegs[0]));
     821                            paSureRegs = (PDBGFREGVALEX)pVMM->pfnMMR3HeapRealloc(pFrame->paSureRegs, iReg * sizeof(paSureRegs[0]));
    819822                        else
    820                             paSureRegs = (PDBGFREGVALEX)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_STACK, iReg * sizeof(paSureRegs[0]));
     823                            paSureRegs = (PDBGFREGVALEX)pVMM->pfnMMR3HeapAllocU(pUVM, MM_TAG_DBGF_STACK, iReg * sizeof(paSureRegs[0]));
    821824                        AssertReturn(paSureRegs, VERR_NO_MEMORY);
    822825
     
    835838    }
    836839
    837     RT_NOREF(pUVM, pvData, idCpu, hAs, pInitialCtx, puScratch);
     840    RT_NOREF(pUVM, pVMM, pvData, idCpu, hAs, pInitialCtx, puScratch);
    838841    return VINF_SUCCESS;
    839842}
     
    843846 * @copydoc DBGFOSREG::pfnQueryInterface
    844847 */
    845 static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    846 {
    847     RT_NOREF(pUVM);
     848static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf)
     849{
     850    RT_NOREF(pUVM, pVMM);
    848851    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
    849852
     
    861864 * @copydoc DBGFOSREG::pfnQueryVersion
    862865 */
    863 static DECLCALLBACK(int)  dbgDiggerWinNtQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
    864 {
    865     RT_NOREF1(pUVM);
     866static DECLCALLBACK(int)  dbgDiggerWinNtQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData,
     867                                                     char *pszVersion, size_t cchVersion)
     868{
     869    RT_NOREF(pUVM, pVMM);
    866870    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
    867871    Assert(pThis->fValid);
     872
    868873    const char *pszNtProductType;
    869874    switch (pThis->NtProductType)
     
    874879        default:                        pszNtProductType = "";              break;
    875880    }
     881
    876882    RTStrPrintf(pszVersion, cchVersion, "%u.%u-%s%s (BuildNumber %u)", pThis->NtMajorVersion, pThis->NtMinorVersion,
    877883                pThis->f32Bit ? "x86" : "AMD64", pszNtProductType, pThis->NtBuildNumber);
     
    883889 * @copydoc DBGFOSREG::pfnTerm
    884890 */
    885 static DECLCALLBACK(void)  dbgDiggerWinNtTerm(PUVM pUVM, void *pvData)
     891static DECLCALLBACK(void)  dbgDiggerWinNtTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    886892{
    887893    RT_NOREF1(pUVM);
     
    893899     * we must unlink and ditch the modules we created.
    894900     */
    895     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     901    RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    896902    if (hDbgAs != NIL_RTDBGAS)
    897903    {
     
    927933 * @copydoc DBGFOSREG::pfnRefresh
    928934 */
    929 static DECLCALLBACK(int)  dbgDiggerWinNtRefresh(PUVM pUVM, void *pvData)
     935static DECLCALLBACK(int)  dbgDiggerWinNtRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    930936{
    931937    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    936942     * For now we'll flush and reload everything.
    937943     */
    938     dbgDiggerWinNtTerm(pUVM, pvData);
    939 
    940     return dbgDiggerWinNtInit(pUVM, pvData);
     944    dbgDiggerWinNtTerm(pUVM, pVMM, pvData);
     945
     946    return dbgDiggerWinNtInit(pUVM, pVMM, pvData);
    941947}
    942948
     
    945951 * @copydoc DBGFOSREG::pfnInit
    946952 */
    947 static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, void *pvData)
     953static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    948954{
    949955    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    962968     * Figure the NT version.
    963969     */
    964     DBGFR3AddrFromFlat(pUVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);
    965     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);
     970    pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);
     971    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);
    966972    if (RT_SUCCESS(rc))
    967973    {
     
    9951001        /* Read the validate the MTE. */
    9961002        NTMTE Mte;
    997         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &Mte, pThis->f32Bit ? sizeof(Mte.vX_32) : sizeof(Mte.vX_64));
     1003        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &Mte, pThis->f32Bit ? sizeof(Mte.vX_32) : sizeof(Mte.vX_64));
    9981004        if (RT_FAILURE(rc))
    9991005            break;
     
    10361042        /* Read the full name. */
    10371043        DBGFADDRESS AddrName;
    1038         DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));
     1044        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));
    10391045        uint16_t    cbName = WINNT_UNION(pThis, &Mte, FullDllName.Length);
    10401046        if (cbName < sizeof(u))
    1041             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
     1047            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
    10421048        else
    10431049            rc = VERR_OUT_OF_RANGE;
    10441050        if (RT_FAILURE(rc))
    10451051        {
    1046             DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));
     1052            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));
    10471053            cbName = WINNT_UNION(pThis, &Mte, BaseDllName.Length);
    10481054            if (cbName < sizeof(u))
    1049                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
     1055                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
    10501056            else
    10511057                rc = VERR_OUT_OF_RANGE;
     
    10641070                /* Read the start of the PE image and pass it along to a worker. */
    10651071                DBGFADDRESS ImageAddr;
    1066                 DBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));
    1067                 dbgDiggerWinNtProcessImage(pThis, pUVM, pszModName, pszFilename, &ImageAddr, cbImageMte);
     1072                pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));
     1073                dbgDiggerWinNtProcessImage(pThis, pUVM, pVMM, pszModName, pszFilename, &ImageAddr, cbImageMte);
    10681074                RTStrFree(pszFilename);
    10691075            }
     
    10721078        /* next */
    10731079        AddrPrev = Addr;
    1074         DBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));
     1080        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));
    10751081    } while (   Addr.FlatPtr != pThis->KernelMteAddr.FlatPtr
    10761082             && Addr.FlatPtr != pThis->PsLoadedModuleListAddr.FlatPtr);
    10771083
    10781084    /* Try resolving the KPCR and KPCRB addresses for each vCPU. */
    1079     dbgDiggerWinNtResolveKpcr(pThis, pUVM);
     1085    dbgDiggerWinNtResolveKpcr(pThis, pUVM, pVMM);
    10801086
    10811087    pThis->fValid = true;
     
    10871093 * @copydoc DBGFOSREG::pfnProbe
    10881094 */
    1089 static DECLCALLBACK(bool)  dbgDiggerWinNtProbe(PUVM pUVM, void *pvData)
     1095static DECLCALLBACK(bool)  dbgDiggerWinNtProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
    10901096{
    10911097    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    11111117     * NT only runs in protected or long mode.
    11121118     */
    1113     CPUMMODE const enmMode = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/);
     1119    CPUMMODE const enmMode = pVMM->pfnDBGFR3CpuGetMode(pUVM, 0 /*idCpu*/);
    11141120    if (enmMode != CPUMMODE_PROTECTED && enmMode != CPUMMODE_LONG)
    11151121        return false;
     
    11261132    uint64_t uIdtrBase = 0;
    11271133    uint16_t uIdtrLimit = 0;
    1128     int rc = DBGFR3RegCpuQueryXdtr(pUVM, 0, DBGFREG_IDTR, &uIdtrBase, &uIdtrLimit);
     1134    int rc = pVMM->pfnDBGFR3RegCpuQueryXdtr(pUVM, 0, DBGFREG_IDTR, &uIdtrBase, &uIdtrLimit);
    11291135    AssertRCReturn(rc, false);
    11301136
     
    11331139        return false;
    11341140
    1135     rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, uIdtrBase), &u, cbMinIdtr);
     1141    rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uIdtrBase), &u, cbMinIdtr);
    11361142    if (RT_FAILURE(rc))
    11371143        return false;
     
    11671173     */
    11681174    DBGFADDRESS KernelAddr;
    1169     for (DBGFR3AddrFromFlat(pUVM, &KernelAddr, uKrnlStart);
     1175    for (pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, uKrnlStart);
    11701176         KernelAddr.FlatPtr < uKrnlEnd;
    11711177         KernelAddr.FlatPtr += PAGE_SIZE)
     
    11731179        bool fNt31 = false;
    11741180        DBGFADDRESS const RetryAddress = KernelAddr;
    1175         rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, uEnd - KernelAddr.FlatPtr,
    1176                            8, "PAGELK\0", sizeof("PAGELK\0"), &KernelAddr);
     1181        rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, uEnd - KernelAddr.FlatPtr,
     1182                                    8, "PAGELK\0", sizeof("PAGELK\0"), &KernelAddr);
    11771183        if (   rc == VERR_DBGF_MEM_NOT_FOUND
    11781184            && enmMode != CPUMMODE_LONG)
     
    11801186            /* NT3.1 didn't have a PAGELK section, so look for _TEXT instead.  The
    11811187               following VirtualSize is zero, so check for that too. */
    1182             rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &RetryAddress, uEnd - RetryAddress.FlatPtr,
    1183                                8, "_TEXT\0\0\0\0\0\0", sizeof("_TEXT\0\0\0\0\0\0"), &KernelAddr);
     1188            rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &RetryAddress, uEnd - RetryAddress.FlatPtr,
     1189                                        8, "_TEXT\0\0\0\0\0\0", sizeof("_TEXT\0\0\0\0\0\0"), &KernelAddr);
    11841190            fNt31 = true;
    11851191        }
    11861192        if (RT_FAILURE(rc))
    11871193            break;
    1188         DBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & PAGE_OFFSET_MASK);
     1194        pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & PAGE_OFFSET_MASK);
    11891195
    11901196        /* MZ + PE header. */
    1191         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));
     1197        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));
    11921198        if (    RT_SUCCESS(rc)
    11931199            &&  u.MzHdr.e_magic == IMAGE_DOS_SIGNATURE
     
    12141220                    uMte.v32.SizeOfImage = !fNt31 ? pHdrs->OptionalHeader.SizeOfImage : 0; /* NT 3.1 didn't set the size. */
    12151221                    DBGFADDRESS HitAddr;
    1216                     rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, uEnd - KernelAddr.FlatPtr,
    1217                                        4 /*align*/, &uMte.v32.DllBase, 3 * sizeof(uint32_t), &HitAddr);
     1222                    rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, uEnd - KernelAddr.FlatPtr,
     1223                                                4 /*align*/, &uMte.v32.DllBase, 3 * sizeof(uint32_t), &HitAddr);
    12181224                    while (RT_SUCCESS(rc))
    12191225                    {
    12201226                        /* check the name. */
    12211227                        DBGFADDRESS MteAddr = HitAddr;
    1222                         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),
    1223                                            &uMte2.v32, sizeof(uMte2.v32));
     1228                        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1229                                                    pVMM->pfnDBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),
     1230                                                    &uMte2.v32, sizeof(uMte2.v32));
    12241231                        if (    RT_SUCCESS(rc)
    12251232                            &&  uMte2.v32.DllBase     == uMte.v32.DllBase
     
    12331240                           )
    12341241                        {
    1235                             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, uMte2.v32.BaseDllName.Buffer),
    1236                                                u.wsz, uMte2.v32.BaseDllName.Length);
     1242                            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1243                                                        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uMte2.v32.BaseDllName.Buffer),
     1244                                                        u.wsz, uMte2.v32.BaseDllName.Length);
    12371245                            u.wsz[uMte2.v32.BaseDllName.Length / 2] = '\0';
    12381246                            if (    RT_SUCCESS(rc)
     
    12421250                               )
    12431251                            {
    1244                                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/,
    1245                                                    DBGFR3AddrFromFlat(pUVM, &Addr, uMte2.v32.InLoadOrderLinks.Blink),
    1246                                                    &uMte3.v32, RT_SIZEOFMEMB(NTMTE32, InLoadOrderLinks));
     1252                                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1253                                                            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr,
     1254                                                                                        uMte2.v32.InLoadOrderLinks.Blink),
     1255                                                            &uMte3.v32, RT_SIZEOFMEMB(NTMTE32, InLoadOrderLinks));
    12471256                                if (   RT_SUCCESS(rc)
    12481257                                    && uMte3.v32.InLoadOrderLinks.Flink == MteAddr.FlatPtr
     
    12681277
    12691278                        /* next */
    1270                         DBGFR3AddrAdd(&HitAddr, 4);
     1279                        pVMM->pfnDBGFR3AddrAdd(&HitAddr, 4);
    12711280                        if (HitAddr.FlatPtr < uEnd)
    1272                             rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, uEnd - HitAddr.FlatPtr,
    1273                                                4 /*align*/, &uMte.v32.DllBase, 3 * sizeof(uint32_t), &HitAddr);
     1281                            rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, uEnd - HitAddr.FlatPtr,
     1282                                                        4 /*align*/, &uMte.v32.DllBase, 3 * sizeof(uint32_t), &HitAddr);
    12741283                        else
    12751284                            rc = VERR_DBGF_MEM_NOT_FOUND;
     
    12971306                    DBGFADDRESS ScanAddr;
    12981307                    DBGFADDRESS HitAddr;
    1299                     rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &ScanAddr, uStart),
    1300                                        uEnd - uStart, 8 /*align*/, &uMte.v64.DllBase, 5 * sizeof(uint32_t), &HitAddr);
     1308                    rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ScanAddr, uStart),
     1309                                                uEnd - uStart, 8 /*align*/, &uMte.v64.DllBase, 5 * sizeof(uint32_t), &HitAddr);
    13011310                    while (RT_SUCCESS(rc))
    13021311                    {
    13031312                        /* Read the start of the MTE and check some basic members. */
    13041313                        DBGFADDRESS MteAddr = HitAddr;
    1305                         rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE64, DllBase)),
    1306                                            &uMte2.v64, sizeof(uMte2.v64));
     1314                        rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1315                                                    pVMM->pfnDBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE64, DllBase)),
     1316                                                    &uMte2.v64, sizeof(uMte2.v64));
    13071317                        if (    RT_SUCCESS(rc)
    13081318                            &&  uMte2.v64.DllBase     == uMte.v64.DllBase
     
    13171327                        {
    13181328                            /* Try read the base name and compare with known NT kernel names. */
    1319                             rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, uMte2.v64.BaseDllName.Buffer),
    1320                                                u.wsz, uMte2.v64.BaseDllName.Length);
     1329                            rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1330                                                        pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uMte2.v64.BaseDllName.Buffer),
     1331                                                        u.wsz, uMte2.v64.BaseDllName.Length);
    13211332                            u.wsz[uMte2.v64.BaseDllName.Length / 2] = '\0';
    13221333                            if (    RT_SUCCESS(rc)
     
    13281339                                /* Read the link entry of the previous entry in the list and check that its
    13291340                                   forward pointer points at the MTE we've found. */
    1330                                 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/,
    1331                                                    DBGFR3AddrFromFlat(pUVM, &Addr, uMte2.v64.InLoadOrderLinks.Blink),
    1332                                                    &uMte3.v64, RT_SIZEOFMEMB(NTMTE64, InLoadOrderLinks));
     1341                                rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/,
     1342                                                            pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr,
     1343                                                                                        uMte2.v64.InLoadOrderLinks.Blink),
     1344                                                            &uMte3.v64, RT_SIZEOFMEMB(NTMTE64, InLoadOrderLinks));
    13331345                                if (   RT_SUCCESS(rc)
    13341346                                    && uMte3.v64.InLoadOrderLinks.Flink == MteAddr.FlatPtr
     
    13541366
    13551367                        /* next */
    1356                         DBGFR3AddrAdd(&HitAddr, 8);
     1368                        pVMM->pfnDBGFR3AddrAdd(&HitAddr, 8);
    13571369                        if (HitAddr.FlatPtr < uEnd)
    1358                             rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, uEnd - HitAddr.FlatPtr,
    1359                                                8 /*align*/, &uMte.v64.DllBase, 3 * sizeof(uint32_t), &HitAddr);
     1370                            rc = pVMM->pfnDBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, uEnd - HitAddr.FlatPtr,
     1371                                                        8 /*align*/, &uMte.v64.DllBase, 3 * sizeof(uint32_t), &HitAddr);
    13601372                        else
    13611373                            rc = VERR_DBGF_MEM_NOT_FOUND;
     
    13721384 * @copydoc DBGFOSREG::pfnDestruct
    13731385 */
    1374 static DECLCALLBACK(void)  dbgDiggerWinNtDestruct(PUVM pUVM, void *pvData)
    1375 {
    1376     RT_NOREF2(pUVM, pvData);
     1386static DECLCALLBACK(void)  dbgDiggerWinNtDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1387{
     1388    RT_NOREF(pUVM, pVMM, pvData);
    13771389}
    13781390
     
    13811393 * @copydoc DBGFOSREG::pfnConstruct
    13821394 */
    1383 static DECLCALLBACK(int)  dbgDiggerWinNtConstruct(PUVM pUVM, void *pvData)
    1384 {
    1385     RT_NOREF1(pUVM);
     1395static DECLCALLBACK(int)  dbgDiggerWinNtConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData)
     1396{
     1397    RT_NOREF(pUVM, pVMM);
    13861398    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
    13871399    pThis->fValid      = false;
  • trunk/src/VBox/Debugger/Makefile.kmk

    r93468 r93470  
    7373DbgPlugInDiggers_LIBS = \
    7474        $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \
    75         $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
    76         $(VBOX_LIB_VMM_LAZY) \
    7775        $(LIB_RUNTIME)
    7876$(call VBOX_SET_VER_INFO_DLL,DbgPlugInDiggers,VirtualBox Debugger Guest OS Digger Plug-in)
     
    117115        -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDbg.dylib
    118116$(call VBOX_SET_VER_INFO_DLL,VBoxDbg,VirtualBox Debugger GUI)
    119 
    120  ifdef VBOX_WITH_TESTCASES
    121 #
    122 # The VBoxDbg testcase (Qt).
    123 #
    124 PROGRAMS += tstVBoxDbg
    125 tstVBoxDbg_TEMPLATE     = VBOXQTGUIEXE
    126 tstVBoxDbg_USES         = qt5
    127 tstVBoxDbg_QTTOOL       = QT5
    128 tstVBoxDbg_QT_MODULES   = Core Gui Widgets
    129 tstVBoxDbg_LIBS.linux   += xcb
    130 tstVBoxDbg_LIBS.solaris += xcb
    131 tstVBoxDbg_LIBS.freebsd += xcb
    132 tstVBoxDbg_SOURCES      = testcase/tstVBoxDbg.cpp
    133 tstVBoxDbg_LIBS         = \
    134         $(LIB_VMM) \
    135         $(LIB_REM) \
    136         $(LIB_RUNTIME)
    137   ifeq ($(KBUILD_TARGET),win)
    138 tstVBoxDbg_LIBS        += \
    139         $(PATH_STAGE_LIB)/VBoxDbg.lib
    140   else
    141 tstVBoxDbg_LIBS        += \
    142         $(PATH_STAGE_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
    143   endif
    144  endif # TESTCASES
    145117endif # Qt
    146118
  • trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp

    r93115 r93470  
    842842}
    843843
     844VMMR3DECL(PCVMMR3VTABLE) VMMR3GetVTable(void)
     845{
     846    return NULL;
     847}
    844848
    845849VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM)
  • trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp

    r93460 r93470  
    10081008            {
    10091009                uint32_t cMessages = aMaxMessages == 0 ? UINT32_MAX : aMaxMessages;
    1010                 vrc = pDmesg->pfnQueryKernelLog(pDmesg, ptrVM.rawUVM(), 0 /*fFlags*/, cMessages,
     1010                vrc = pDmesg->pfnQueryKernelLog(pDmesg, ptrVM.rawUVM(), ptrVM.vtable(), 0 /*fFlags*/, cMessages,
    10111011                                                aDmesg.mutableRaw(), cbBuf, &cbActual);
    10121012
     
    10171017                    vrc = aDmesg.reserveNoThrow(cbBuf);
    10181018                    if (RT_SUCCESS(vrc))
    1019                         vrc = pDmesg->pfnQueryKernelLog(pDmesg, ptrVM.rawUVM(), 0 /*fFlags*/, cMessages,
     1019                        vrc = pDmesg->pfnQueryKernelLog(pDmesg, ptrVM.rawUVM(), ptrVM.vtable(), 0 /*fFlags*/, cMessages,
    10201020                                                        aDmesg.mutableRaw(), cbBuf, &cbActual);
    10211021                }
  • trunk/src/VBox/VMM/VMMR3/CFGM.cpp

    r93444 r93470  
    6060#include <VBox/vmm/dbgf.h>
    6161#include <VBox/vmm/mm.h>
     62#include <VBox/vmm/vmm.h>
    6263#include "CFGMInternal.h"
    6364#include <VBox/vmm/vm.h>
    6465#include <VBox/vmm/uvm.h>
    65 #include <VBox/vmm/vmmr3vtable.h>
    6666#include <VBox/err.h>
    6767
  • trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp

    r93115 r93470  
    2323#include <VBox/vmm/dbgf.h>
    2424#include <VBox/vmm/mm.h>
     25#include <VBox/vmm/vmm.h>
    2526#include "DBGFInternal.h"
    2627#include <VBox/vmm/uvm.h>
     
    116117    if (pUVM->dbgf.s.pCurOS)
    117118    {
    118         pUVM->dbgf.s.pCurOS->pReg->pfnTerm(pUVM, pUVM->dbgf.s.pCurOS->abData);
     119        pUVM->dbgf.s.pCurOS->pReg->pfnTerm(pUVM, VMMR3GetVTable(), pUVM->dbgf.s.pCurOS->abData);
    119120        pUVM->dbgf.s.pCurOS = NULL;
    120121    }
     
    144145        pUVM->dbgf.s.pOSHead = pOS->pNext;
    145146        if (pOS->pReg->pfnDestruct)
    146             pOS->pReg->pfnDestruct(pUVM, pOS->abData);
     147            pOS->pReg->pfnDestruct(pUVM, VMMR3GetVTable(), pOS->abData);
    147148
    148149        PDBGFOSEMTWRAPPER pFree = pOS->pWrapperHead;
     
    189190    pOS->pReg = pReg;
    190191
    191     int rc = pOS->pReg->pfnConstruct(pUVM, pOS->abData);
     192    int rc = pOS->pReg->pfnConstruct(pUVM, VMMR3GetVTable(), pOS->abData);
    192193    if (RT_SUCCESS(rc))
    193194    {
     
    200201    {
    201202        if (pOS->pReg->pfnDestruct)
    202             pOS->pReg->pfnDestruct(pUVM, pOS->abData);
     203            pOS->pReg->pfnDestruct(pUVM, VMMR3GetVTable(), pOS->abData);
    203204        MMR3HeapFree(pOS);
    204205    }
     
    291292     */
    292293    if (fWasCurOS)
    293         pOS->pReg->pfnTerm(pUVM, pOS->abData);
     294        pOS->pReg->pfnTerm(pUVM, VMMR3GetVTable(), pOS->abData);
    294295    if (pOS->pReg->pfnDestruct)
    295         pOS->pReg->pfnDestruct(pUVM, pOS->abData);
     296        pOS->pReg->pfnDestruct(pUVM, VMMR3GetVTable(), pOS->abData);
    296297
    297298    PDBGFOSEMTWRAPPER pFree = pOS->pWrapperHead;
     
    371372
    372373    for (PDBGFOS pNewOS = pUVM->dbgf.s.pOSHead; pNewOS; pNewOS = pNewOS->pNext)
    373         if (pNewOS->pReg->pfnProbe(pUVM, pNewOS->abData))
     374        if (pNewOS->pReg->pfnProbe(pUVM, VMMR3GetVTable(), pNewOS->abData))
    374375        {
    375376            int rc;
    376377            pUVM->dbgf.s.pCurOS = pNewOS;
    377378            if (pOldOS == pNewOS)
    378                 rc = pNewOS->pReg->pfnRefresh(pUVM, pNewOS->abData);
     379                rc = pNewOS->pReg->pfnRefresh(pUVM, VMMR3GetVTable(), pNewOS->abData);
    379380            else
    380381            {
    381382                if (pOldOS)
    382                     pOldOS->pReg->pfnTerm(pUVM, pNewOS->abData);
    383                 rc = pNewOS->pReg->pfnInit(pUVM, pNewOS->abData);
     383                    pOldOS->pReg->pfnTerm(pUVM, VMMR3GetVTable(), pNewOS->abData);
     384                rc = pNewOS->pReg->pfnInit(pUVM, VMMR3GetVTable(), pNewOS->abData);
    384385            }
    385386            if (pszName && cchName)
     
    392393    /* not found */
    393394    if (pOldOS)
    394         pOldOS->pReg->pfnTerm(pUVM, pOldOS->abData);
     395        pOldOS->pReg->pfnTerm(pUVM, VMMR3GetVTable(), pOldOS->abData);
    395396
    396397    DBGF_OS_WRITE_UNLOCK(pUVM);
     
    463464        if (pszVersion && cchVersion)
    464465        {
    465             int rc2 = pUVM->dbgf.s.pCurOS->pReg->pfnQueryVersion(pUVM, pUVM->dbgf.s.pCurOS->abData, pszVersion, cchVersion);
     466            int rc2 = pUVM->dbgf.s.pCurOS->pReg->pfnQueryVersion(pUVM, VMMR3GetVTable(),  pUVM->dbgf.s.pCurOS->abData,
     467                                                                 pszVersion, cchVersion);
    466468            if (RT_FAILURE(rc2) || rc == VINF_SUCCESS)
    467469                rc = rc2;
     
    516518 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog, Generic EMT wrapper.}
    517519 */
    518 static DECLCALLBACK(int) dbgfR3OSEmtIDmesg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, uint32_t fFlags, uint32_t cMessages,
    519                                                           char *pszBuf, size_t cbBuf, size_t *pcbActual)
     520static DECLCALLBACK(int) dbgfR3OSEmtIDmesg_QueryKernelLog(PDBGFOSIDMESG pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, uint32_t fFlags,
     521                                                          uint32_t cMessages, char *pszBuf, size_t cbBuf, size_t *pcbActual)
    520522{
    521523    PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.Dmesg);
     
    529531
    530532    return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/,
    531                                    (PFNRT)pWrapper->uDigger.pDmesg->pfnQueryKernelLog, 7,
    532                                     pWrapper->uDigger.pDmesg, pUVM, fFlags, cMessages, pszBuf, cbBuf, pcbActual);
     533                                   (PFNRT)pWrapper->uDigger.pDmesg->pfnQueryKernelLog, 8,
     534                                    pWrapper->uDigger.pDmesg, pUVM, pVMM, fFlags, cMessages, pszBuf, cbBuf, pcbActual);
    533535
    534536}
     
    538540 * @interface_method_impl{DBGFOSIWINNT,pfnQueryVersion, Generic EMT wrapper.}
    539541 */
    540 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryVersion(PDBGFOSIWINNT pThis, PUVM pUVM, uint32_t *puVersMajor, uint32_t *puVersMinor,
    541                                                         uint32_t *puBuildNumber, bool *pf32Bit)
     542static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryVersion(PDBGFOSIWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, uint32_t *puVersMajor,
     543                                                        uint32_t *puVersMinor, uint32_t *puBuildNumber, bool *pf32Bit)
    542544{
    543545    PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.WinNt);
     
    546548
    547549    return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/,
    548                                    (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryVersion, 6,
    549                                     pWrapper->uDigger.pWinNt, pUVM, puVersMajor, puVersMinor,
     550                                   (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryVersion, 7,
     551                                    pWrapper->uDigger.pWinNt, pUVM, pVMM, puVersMajor, puVersMinor,
    550552                                    puBuildNumber, pf32Bit);
    551553}
     
    555557 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKernelPtrs, Generic EMT wrapper.}
    556558 */
    557 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKernelPtrs(PDBGFOSIWINNT pThis, PUVM pUVM,
     559static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKernelPtrs(PDBGFOSIWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
    558560                                                           PRTGCUINTPTR pGCPtrKernBase, PRTGCUINTPTR pGCPtrPsLoadedModuleList)
    559561{
     
    563565
    564566    return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/,
    565                                    (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryKernelPtrs, 4,
    566                                     pWrapper->uDigger.pWinNt, pUVM, pGCPtrKernBase, pGCPtrPsLoadedModuleList);
     567                                   (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryKernelPtrs, 5,
     568                                    pWrapper->uDigger.pWinNt, pUVM, pVMM, pGCPtrKernBase, pGCPtrPsLoadedModuleList);
    567569}
    568570
     
    571573 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKpcrForVCpu, Generic EMT wrapper.}
    572574 */
    573 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,
    574                                                             PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb)
     575static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     576                                                            VMCPUID idCpu, PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb)
    575577{
    576578    PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.WinNt);
     
    579581
    580582    return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/,
    581                                     (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryKpcrForVCpu, 5,
    582                                     pWrapper->uDigger.pWinNt, pUVM, idCpu, pKpcr, pKpcrb);
     583                                    (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryKpcrForVCpu, 6,
     584                                    pWrapper->uDigger.pWinNt, pUVM, pVMM, idCpu, pKpcr, pKpcrb);
    583585}
    584586
     
    587589 * @interface_method_impl{DBGFOSIWINNT,pfnQueryCurThrdForVCpu, Generic EMT wrapper.}
    588590 */
    589 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,
    590                                                                PRTGCUINTPTR pCurThrd)
     591static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM,
     592                                                               VMCPUID idCpu, PRTGCUINTPTR pCurThrd)
    591593{
    592594    PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.WinNt);
     
    595597
    596598    return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/,
    597                                     (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryCurThrdForVCpu, 4,
    598                                     pWrapper->uDigger.pWinNt, pUVM, idCpu, pCurThrd);
     599                                    (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryCurThrdForVCpu, 5,
     600                                    pWrapper->uDigger.pWinNt, pUVM, pVMM, idCpu, pCurThrd);
    599601}
    600602
     
    622624    {
    623625        void *pvDiggerIf;
    624         pvDiggerIf = pOS->pReg->pfnQueryInterface(pUVM, pUVM->dbgf.s.pCurOS->abData, enmIf);
     626        pvDiggerIf = pOS->pReg->pfnQueryInterface(pUVM, VMMR3GetVTable(), pUVM->dbgf.s.pCurOS->abData, enmIf);
    625627        if (pvDiggerIf)
    626628        {
     
    730732        PDBGFOS pOS = pUVM->dbgf.s.pCurOS;
    731733        if (pOS)
    732             rc = pOS->pReg->pfnStackUnwindAssist(pUVM, pUVM->dbgf.s.pCurOS->abData, idCpu, pFrame,
     734            rc = pOS->pReg->pfnStackUnwindAssist(pUVM, VMMR3GetVTable(), pUVM->dbgf.s.pCurOS->abData, idCpu, pFrame,
    733735                                                 pState, pInitialCtx, hAs, puScratch);
    734736        DBGF_OS_READ_UNLOCK(pUVM);
  • trunk/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp

    r93115 r93470  
    2323#include <VBox/vmm/dbgf.h>
    2424#include <VBox/vmm/mm.h>
     25#include <VBox/vmm/vmm.h>
    2526#include "DBGFInternal.h"
    2627#include <VBox/vmm/uvm.h>
     
    367368         * Try initialize it.
    368369         */
    369         rc = pPlugIn->pfnEntry(DBGFPLUGINOP_INIT, pUVM, VBOX_VERSION);
     370        rc = pPlugIn->pfnEntry(DBGFPLUGINOP_INIT, pUVM, VMMR3GetVTable(), VBOX_VERSION);
    370371        if (RT_SUCCESS(rc))
    371372        {
     
    538539            pUVM->dbgf.s.pPlugInHead = pPlugIn->pNext;
    539540
    540         pPlugIn->pfnEntry(DBGFPLUGINOP_TERM, pUVM, 0);
     541        pPlugIn->pfnEntry(DBGFPLUGINOP_TERM, pUVM, VMMR3GetVTable(), 0);
    541542        RTLdrClose(pPlugIn->hLdrMod);
    542543
     
    568569        pUVM->dbgf.s.pPlugInHead = pPlugin->pNext;
    569570
    570         pPlugin->pfnEntry(DBGFPLUGINOP_TERM, pUVM, 0);
     571        pPlugin->pfnEntry(DBGFPLUGINOP_TERM, pUVM, VMMR3GetVTable(), 0);
    571572
    572573        int rc2 = RTLdrClose(pPlugin->hLdrMod);
  • trunk/src/VBox/VMM/VMMR3/SSM.cpp

    r93444 r93470  
    150150#include <VBox/vmm/pdmcritsect.h>
    151151#include <VBox/vmm/mm.h>
     152#include <VBox/vmm/vmm.h>
    152153#include "SSMInternal.h"
    153154#include <VBox/vmm/vm.h>
    154155#include <VBox/vmm/uvm.h>
    155 #include <VBox/vmm/vmmr3vtable.h>
    156156#include <VBox/err.h>
    157157#include <VBox/log.h>
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r93444 r93470  
    6868#include "VMInternal.h"
    6969#include <VBox/vmm/vmcc.h>
    70 #include <VBox/vmm/vmmr3vtable.h>
    7170
    7271#include <VBox/sup.h>
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