- Timestamp:
- Jan 27, 2022 11:51:28 PM (3 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 1 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCCommands.cpp
r93115 r93470 1093 1093 if (pszBuf) 1094 1094 { 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); 1096 1096 1097 1097 uint32_t cTries = 10; … … 1106 1106 break; 1107 1107 } 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); 1109 1109 } 1110 1110 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Debugger/DBGCRemoteKd.cpp
r93115 r93470 2750 2750 if (pThis->pIfWinNt) 2751 2751 { 2752 int rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM, 2752 int rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(), 2753 2753 NULL /*puVersMajor*/, NULL /*puVersMinor*/, 2754 2754 &NtBuildNumber, &f32Bit); 2755 2755 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, 2757 2758 &Resp.u.GetVersion.u64PtrPsLoadedModuleList); 2758 2759 } … … 3028 3029 RTGCUINTPTR GCPtrKpcr = 0; 3029 3030 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, 3031 3032 &GCPtrKpcr, NULL /*pKpcrb*/); 3032 3033 if (RT_SUCCESS(rc)) … … 3043 3044 RTGCUINTPTR GCPtrKpcrb = 0; 3044 3045 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, 3046 3047 NULL /*pKpcr*/, &GCPtrKpcrb); 3047 3048 if (RT_SUCCESS(rc)) … … 3065 3066 RTGCUINTPTR GCPtrCurThrd = 0; 3066 3067 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); 3069 3070 if (RT_SUCCESS(rc)) 3070 3071 memcpy(&abResp[0], &GCPtrCurThrd, sizeof(GCPtrCurThrd)); … … 3586 3587 if (pThis->pIfWinNt) 3587 3588 { 3588 rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM, 3589 rc = pThis->pIfWinNt->pfnQueryVersion(pThis->pIfWinNt, pThis->Dbgc.pUVM, VMMR3GetVTable(), 3589 3590 NULL /*puVersMajor*/, NULL /*puVersMinor*/, 3590 3591 NULL /*puBuildNumber*/, &pThis->f32Bit); -
trunk/src/VBox/Debugger/DBGPlugInCommonELF.cpp
r93115 r93470 23 23 #include "DBGPlugInCommonELF.h" 24 24 25 #include <VBox/vmm/ dbgf.h>25 #include <VBox/vmm/vmmr3vtable.h> 26 26 #include <iprt/alloca.h> 27 27 #include <iprt/asm.h> -
trunk/src/VBox/Debugger/DBGPlugInCommonELF.h
r93115 r93470 38 38 /** @} */ 39 39 40 int DBGDiggerCommonParseElf32Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,40 int DBGDiggerCommonParseElf32Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags, 41 41 Elf32_Ehdr const *pEhdr, Elf32_Shdr const *paShdrs, 42 42 Elf32_Sym const *paSyms, size_t cMaxSyms, … … 44 44 RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag); 45 45 46 int DBGDiggerCommonParseElf64Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,46 int DBGDiggerCommonParseElf64Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags, 47 47 Elf64_Ehdr const *pEhdr, Elf64_Shdr const *paShdrs, 48 48 Elf64_Sym const *paSyms, size_t cMaxSyms, -
trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h
r93115 r93470 45 45 * 46 46 * @param pUVM The user mode VM handle. 47 * @param pVMM The VMM function table. 47 48 * @param pszModName The module name. 48 49 * @param pszFilename The filename. optional. … … 69 70 * @param uModTag Module tag. Pass 0 if tagging is of no interest. 70 71 */ 71 int DBGDiggerCommonParseElfMod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,72 int DBGDiggerCommonParseElfMod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags, 72 73 Elf_Ehdr const *pEhdr, Elf_Shdr const *paShdrs, 73 74 Elf_Sym const *paSyms, size_t cMaxSyms, … … 76 77 { 77 78 AssertPtrReturn(pUVM, VERR_INVALID_POINTER); 79 AssertPtrReturn(pVMM, VERR_INVALID_POINTER); 78 80 AssertPtrReturn(pszModName, VERR_INVALID_POINTER); 79 81 AssertPtrReturn(pszFilename, VERR_INVALID_POINTER); … … 315 317 * Link it into the address space. 316 318 */ 317 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);319 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 318 320 if (hAs != NIL_RTDBGAS) 319 321 rc = dbgDiggerCommonLinkElfSegs(hAs, hMod, paSegs, cSegs); -
trunk/src/VBox/Debugger/DBGPlugInDarwin.cpp
r93115 r93470 22 22 #define LOG_GROUP LOG_GROUP_DBGF /// @todo add new log group. 23 23 #include "DBGPlugIns.h" 24 #include <VBox/vmm/ dbgf.h>24 #include <VBox/vmm/vmmr3vtable.h> 25 25 #include <iprt/err.h> 26 26 #include <iprt/mem.h> … … 132 132 * Internal Functions * 133 133 *********************************************************************************************************************************/ 134 static DECLCALLBACK(int) dbgDiggerDarwinInit(PUVM pUVM, void *pvData);134 static DECLCALLBACK(int) dbgDiggerDarwinInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData); 135 135 136 136 … … 139 139 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog} 140 140 */ 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)141 static 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) 143 143 { 144 144 RT_NOREF1(fFlags); … … 151 151 * The 'msgbufp' variable points to a struct msgbuf (bsd/kern/subr_log.c). 152 152 */ 153 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);153 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 154 154 RTDBGMOD hMod; 155 155 int rc = RTDbgAsModuleByName(hAs, "mach_kernel", 0, &hMod); … … 164 164 if (RT_SUCCESS(rc)) 165 165 { 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)); 168 169 if (RT_FAILURE(rc)) 169 170 { … … 204 205 uint64_t msg_bufc; /**< Size depends on windows size. */ 205 206 } 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)) ); 208 209 if (RT_FAILURE(rc)) 209 210 { … … 239 240 return VERR_INVALID_STATE; 240 241 } 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); 242 244 if (RT_SUCCESS(rc)) 243 245 { … … 312 314 * @copydoc DBGFOSREG::pfnStackUnwindAssist 313 315 */ 314 static DECLCALLBACK(int) dbgDiggerDarwinStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,315 P RTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,316 uint64_t *puScratch)317 { 318 RT_NOREF(pUVM, p vData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);316 static 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); 319 321 return VINF_SUCCESS; 320 322 } … … 324 326 * @copydoc DBGFOSREG::pfnQueryInterface 325 327 */ 326 static DECLCALLBACK(void *) dbgDiggerDarwinQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)327 { 328 RT_NOREF 1(pUVM);328 static DECLCALLBACK(void *) dbgDiggerDarwinQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf) 329 { 330 RT_NOREF(pUVM, pVMM); 329 331 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; 330 332 switch (enmIf) … … 342 344 * @copydoc DBGFOSREG::pfnQueryVersion 343 345 */ 344 static DECLCALLBACK(int) dbgDiggerDarwinQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 346 static DECLCALLBACK(int) dbgDiggerDarwinQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, 347 char *pszVersion, size_t cchVersion) 345 348 { 346 349 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; … … 350 353 * It's all in the linux banner. 351 354 */ 352 int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrKernelVersion, pszVersion, cchVersion);355 int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &pThis->AddrKernelVersion, pszVersion, cchVersion); 353 356 if (RT_SUCCESS(rc)) 354 357 { … … 370 373 * @copydoc DBGFOSREG::pfnTerm 371 374 */ 372 static DECLCALLBACK(void) dbgDiggerDarwinTerm(PUVM pUVM, void *pvData)373 { 374 RT_NOREF 1(pUVM);375 static DECLCALLBACK(void) dbgDiggerDarwinTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 376 { 377 RT_NOREF(pUVM, pVMM); 375 378 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; 376 379 … … 382 385 * @copydoc DBGFOSREG::pfnRefresh 383 386 */ 384 static DECLCALLBACK(int) dbgDiggerDarwinRefresh(PUVM pUVM, void *pvData)387 static DECLCALLBACK(int) dbgDiggerDarwinRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 385 388 { 386 389 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; … … 391 394 * For now we'll flush and reload everything. 392 395 */ 393 dbgDiggerDarwinTerm(pUVM, p vData);394 return dbgDiggerDarwinInit(pUVM, p vData);396 dbgDiggerDarwinTerm(pUVM, pVMM, pvData); 397 return dbgDiggerDarwinInit(pUVM, pVMM, pvData); 395 398 } 396 399 … … 402 405 * @returns true if present, false if not. 403 406 * @param pUVM The user mode VM structure. 407 * @param pVMM The VMM function table. 404 408 * @param uSegAddr The segment addresss. 405 409 * @param cbSeg The segment size. … … 407 411 * @param uMaxAddr Highest allowed address. 408 412 */ 409 static bool dbgDiggerDarwinIsSegmentPresent(PUVM pUVM, uint64_t uSegAddr, uint64_t cbSeg, uint64_t uMinAddr, uint64_t uMaxAddr) 413 static bool dbgDiggerDarwinIsSegmentPresent(PUVM pUVM, PCVMMR3VTABLE pVMM, uint64_t uSegAddr, uint64_t cbSeg, 414 uint64_t uMinAddr, uint64_t uMaxAddr) 410 415 { 411 416 /* … … 449 454 uint8_t abBuf[8]; 450 455 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)); 452 458 if (RT_FAILURE(rc)) 453 459 { … … 500 506 501 507 502 static int dbgDiggerDarwinAddModule(PDBGDIGGERDARWIN pThis, PUVM pUVM, uint64_t uModAddr, const char *pszName, bool *pf64Bit) 508 static int dbgDiggerDarwinAddModule(PDBGDIGGERDARWIN pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 509 uint64_t uModAddr, const char *pszName, bool *pf64Bit) 503 510 { 504 511 RT_NOREF1(pThis); … … 512 519 /* Read the first page of the image. */ 513 520 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); 515 523 if (RT_FAILURE(rc)) 516 524 return rc; … … 539 547 if (uBuf.Hdr32.sizeofcmds + (f64Bit ? sizeof(mach_header_64_t) : sizeof(mach_header_32_t)) > X86_PAGE_4K_SIZE) 540 548 { 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); 543 551 if (RT_FAILURE(rc)) 544 552 return rc; … … 578 586 return VERR_INVALID_NAME; 579 587 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, 581 589 uModAddr, uModAddr + _64M))) 582 590 break; /* This usually is discarded or not loaded at all. */ … … 599 607 return VERR_INVALID_NAME; 600 608 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, 602 610 uModAddr, uModAddr + _128M))) 603 611 break; /* This usually is discarded or not loaded at all. */ … … 658 666 RTDBGMOD hMod; 659 667 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), 661 669 RTDBGMOD_F_NOT_DEFERRED | (fHasLinkEdit ? RTDBGMOD_F_MACHO_LOAD_LINKEDIT : 0)); 662 670 … … 670 678 DBGFADDRESS DbgfAddr; 671 679 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)); 676 684 if (RT_FAILURE(rc)) 677 685 LogRel(("OSXDig: Failed to do an in-memory-opening of '%s' at %#RX64: %Rrc%s%s\n", pszName, uModAddr, rc, … … 718 726 * Link the module. 719 727 */ 720 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);728 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 721 729 if (hAs != NIL_RTDBGAS) 722 730 { … … 788 796 * @copydoc DBGFOSREG::pfnInit 789 797 */ 790 static DECLCALLBACK(int) dbgDiggerDarwinInit(PUVM pUVM, void *pvData)798 static DECLCALLBACK(int) dbgDiggerDarwinInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 791 799 { 792 800 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; … … 797 805 */ 798 806 bool f64Bit; 799 int rc = dbgDiggerDarwinAddModule(pThis, pUVM, p This->AddrKernel.FlatPtr, "mach_kernel", &f64Bit);807 int rc = dbgDiggerDarwinAddModule(pThis, pUVM, pVMM, pThis->AddrKernel.FlatPtr, "mach_kernel", &f64Bit); 800 808 if (RT_SUCCESS(rc)) 801 809 { … … 809 817 */ 810 818 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); 812 820 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); 814 822 if (RT_SUCCESS(rc)) 815 823 { 816 824 DBGFADDRESS AddrModInfo; 817 DBGFR3AddrFromFlat(pUVM, &AddrModInfo, SymInfo.Value);825 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrModInfo, SymInfo.Value); 818 826 819 827 /* Read the variable. */ 820 828 RTUINT64U uKmodValue = { 0 }; 821 829 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)); 823 831 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)); 825 833 if (RT_SUCCESS(rc)) 826 834 { 827 DBGFR3AddrFromFlat(pUVM, &AddrModInfo, uKmodValue.u);835 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrModInfo, uKmodValue.u); 828 836 829 837 /* Walk the list of modules. */ … … 857 865 } uMod; 858 866 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)); 861 869 if (RT_FAILURE(rc)) 862 870 { … … 941 949 LogRel(("OSXDig: kmod_info @%RGv: '%s' ver '%s', image @%#llx LB %#llx cbHdr=%#llx\n", AddrModInfo.FlatPtr, 942 950 pszName, pszVersion, uImageAddr, cbImage, cbHdr)); 943 rc = dbgDiggerDarwinAddModule(pThis, pUVM, uImageAddr, pszName, NULL);951 rc = dbgDiggerDarwinAddModule(pThis, pUVM, pVMM, uImageAddr, pszName, NULL); 944 952 945 953 … … 947 955 * Advance to the next kmod_info entry. 948 956 */ 949 DBGFR3AddrFromFlat(pUVM, &AddrModInfo, f64Bit ? uMod.Info64.next : uMod.Info32.next);957 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrModInfo, f64Bit ? uMod.Info64.next : uMod.Info32.next); 950 958 } 951 959 } … … 967 975 * @copydoc DBGFOSREG::pfnProbe 968 976 */ 969 static DECLCALLBACK(bool) dbgDiggerDarwinProbe(PUVM pUVM, void *pvData)977 static DECLCALLBACK(bool) dbgDiggerDarwinProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 970 978 { 971 979 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; … … 986 994 { UINT64_C(0x00001000), UINT64_C(0x0ffff000), } 987 995 }; 988 for (unsigned iRange = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/) != CPUMMODE_LONG;996 for (unsigned iRange = pVMM->pfnDBGFR3CpuGetMode(pUVM, 0 /*idCpu*/) != CPUMMODE_LONG; 989 997 iRange < RT_ELEMENTS(s_aRanges); 990 998 iRange++) 991 999 { 992 1000 DBGFADDRESS KernelAddr; 993 for ( DBGFR3AddrFromFlat(pUVM, &KernelAddr, s_aRanges[iRange].uStart);1001 for (pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, s_aRanges[iRange].uStart); 994 1002 KernelAddr.FlatPtr < s_aRanges[iRange].uEnd; 995 1003 KernelAddr.FlatPtr += X86_PAGE_4K_SIZE) … … 1001 1009 }; 1002 1010 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); 1005 1013 if (RT_FAILURE(rc)) 1006 1014 break; 1007 DBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & X86_PAGE_4K_OFFSET_MASK);1015 pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & X86_PAGE_4K_OFFSET_MASK); 1008 1016 1009 1017 /* … … 1016 1024 mach_header_32_t Hdr32; 1017 1025 } 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); 1019 1027 if (RT_FAILURE(rc)) 1020 1028 continue; … … 1047 1055 * Finally, find the kernel version string. 1048 1056 */ 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); 1051 1059 if (RT_FAILURE(rc)) 1052 DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelVersion, 0);1060 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelVersion, 0); 1053 1061 return true; 1054 1062 } … … 1061 1069 * @copydoc DBGFOSREG::pfnDestruct 1062 1070 */ 1063 static DECLCALLBACK(void) dbgDiggerDarwinDestruct(PUVM pUVM, void *pvData) 1064 { 1065 RT_NOREF2(pUVM, pvData); 1066 1071 static DECLCALLBACK(void) dbgDiggerDarwinDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1072 { 1073 RT_NOREF(pUVM, pVMM, pvData); 1067 1074 } 1068 1075 … … 1071 1078 * @copydoc DBGFOSREG::pfnConstruct 1072 1079 */ 1073 static DECLCALLBACK(int) dbgDiggerDarwinConstruct(PUVM pUVM, void *pvData)1074 { 1075 RT_NOREF 1(pUVM);1080 static DECLCALLBACK(int) dbgDiggerDarwinConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1081 { 1082 RT_NOREF(pUVM, pVMM); 1076 1083 PDBGDIGGERDARWIN pThis = (PDBGDIGGERDARWIN)pvData; 1077 1084 -
trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp
r93115 r93470 22 22 #define LOG_GROUP LOG_GROUP_DBGC 23 23 #include <VBox/dbg.h> 24 #include <VBox/vmm/ dbgf.h>24 #include <VBox/vmm/vmmr3vtable.h> 25 25 #include "DBGPlugIns.h" 26 26 #include <VBox/version.h> … … 28 28 29 29 30 DECLEXPORT(int) DbgPlugInEntry(DBGFPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg)30 DECLEXPORT(int) DbgPlugInEntry(DBGFPLUGINOP enmOperation, PUVM pUVM, PCVMMR3VTABLE pVMM, uintptr_t uArg) 31 31 { 32 32 static PCDBGFOSREG s_aPlugIns[] = … … 49 49 for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++) 50 50 { 51 int rc = DBGFR3OSRegister(pUVM, s_aPlugIns[i]);51 int rc = pVMM->pfnDBGFR3OSRegister(pUVM, s_aPlugIns[i]); 52 52 if (RT_FAILURE(rc)) 53 53 { 54 54 AssertRC(rc); 55 55 while (i-- > 0) 56 DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);56 pVMM->pfnDBGFR3OSDeregister(pUVM, s_aPlugIns[i]); 57 57 return rc; 58 58 } … … 65 65 for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++) 66 66 { 67 int rc = DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);67 int rc = pVMM->pfnDBGFR3OSDeregister(pUVM, s_aPlugIns[i]); 68 68 AssertRC(rc); 69 69 } -
trunk/src/VBox/Debugger/DBGPlugInFreeBsd.cpp
r93115 r93470 23 23 #include "DBGPlugIns.h" 24 24 #include "DBGPlugInCommonELF.h" 25 #include <VBox/vmm/ dbgf.h>25 #include <VBox/vmm/vmmr3vtable.h> 26 26 #include <iprt/asm.h> 27 27 #include <iprt/ctype.h> … … 195 195 * Internal Functions * 196 196 *********************************************************************************************************************************/ 197 static DECLCALLBACK(int) dbgDiggerFreeBsdInit(PUVM pUVM, void *pvData);197 static DECLCALLBACK(int) dbgDiggerFreeBsdInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData); 198 198 199 199 … … 226 226 * @param cbDynstr Size of the .dynstr section. 227 227 */ 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)228 static 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) 231 231 { 232 232 LogFlowFunc(("pThis=%#p pszName=%s uKernelStart=%RGv cbKernel=%zu pAddrDynsym=%#p{%RGv} cSymbols=%u pAddrDynstr=%#p{%RGv} cbDynstr=%zu\n", … … 234 234 235 235 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); 237 237 if (RT_SUCCESS(rc)) 238 238 { 239 239 uint32_t cbDynsymEnt = pThis->f64Bit ? sizeof(Elf64_Sym) : sizeof(Elf32_Sym); 240 240 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); 242 242 if (RT_SUCCESS(rc)) 243 243 { … … 294 294 if (RT_SUCCESS(rc)) 295 295 { 296 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);296 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 297 297 if (hAs != NIL_RTDBGAS) 298 298 rc = RTDbgAsModuleLink(hAs, hMod, uKernelStart, RTDBGASLINK_FLAGS_REPLACE); … … 327 327 * @param pThis The instance data. 328 328 * @param pUVM The user mode VM handle. 329 * @param pVMM The VMM function table. 329 330 * @param pszName The image name. 330 331 */ 331 static void dbgDiggerFreeBsdProcessKernelImage(PDBGDIGGERFBSD pThis, PUVM pUVM, const char *pszName)332 static void dbgDiggerFreeBsdProcessKernelImage(PDBGDIGGERFBSD pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszName) 332 333 { 333 334 /* … … 378 379 size_t cbToRead = RT_MIN(sizeof(achBuf), AddrCur.FlatPtr - AddrInterpEnd.FlatPtr); 379 380 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); 381 382 if (RT_FAILURE(rc)) 382 383 break; … … 403 404 { 404 405 /* Two consecutive terminator symbols mean end of .dynstr section. */ 405 DBGFR3AddrAdd(&AddrCur, i);406 pVMM->pfnDBGFR3AddrAdd(&AddrCur, i); 406 407 DBGFADDRESS AddrDynstrStart = AddrCur; 407 408 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))); 409 410 LogFlowFunc(("Found all required section start addresses (.dynsym=%RGv cSymbols=%u, .dynstr=%RGv cb=%u)\n", 410 411 AddrDynsymStart.FlatPtr, cSymbols, AddrDynstrStart.FlatPtr, 411 412 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, 413 415 pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr); 414 416 return; … … 431 433 { 432 434 /* Indicates the end of the .dynstr section. */ 433 DBGFR3AddrAdd(&AddrCur, i);435 pVMM->pfnDBGFR3AddrAdd(&AddrCur, i); 434 436 DBGFADDRESS AddrDynstrStart = AddrCur; 435 437 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))); 437 439 LogFlowFunc(("Found all required section start addresses (.dynsym=%RGv cSymbols=%u, .dynstr=%RGv cb=%u)\n", 438 440 AddrDynsymStart.FlatPtr, cSymbols, AddrDynstrStart.FlatPtr, 439 441 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, 441 444 pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr); 442 445 return; … … 455 458 /* Calculate the start of the .hash section. */ 456 459 DBGFADDRESS AddrHashStart = pThis->AddrKernelInterp; 457 DBGFR3AddrAdd(&AddrHashStart, sizeof(g_abNeedleInterp));460 pVMM->pfnDBGFR3AddrAdd(&AddrHashStart, sizeof(g_abNeedleInterp)); 458 461 AddrHashStart.FlatPtr = RT_ALIGN_GCPT(AddrHashStart.FlatPtr, pThis->f64Bit ? 8 : 4, RTGCUINTPTR); 459 462 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)); 461 464 if (RT_SUCCESS(rc)) 462 465 { … … 469 472 RTGCUINTPTR uKernelStart = pThis->AddrKernelElfStart.FlatPtr; 470 473 471 DBGFR3AddrAdd(&AddrDynsymStart, cbHash);474 pVMM->pfnDBGFR3AddrAdd(&AddrDynsymStart, cbHash); 472 475 AddrDynsymStart.FlatPtr = RT_ALIGN_GCPT(AddrDynsymStart.FlatPtr, pThis->f64Bit ? 8 : 4, RTGCUINTPTR); 473 476 … … 479 482 size_t cbToRead = RT_MIN(sizeof(abBuf), pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr); 480 483 481 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrDynstrStart, &abBuf[0], cbToRead);484 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrDynstrStart, &abBuf[0], cbToRead); 482 485 if (RT_FAILURE(rc)) 483 486 break; … … 522 525 if (!cbLeft) 523 526 { 524 DBGFR3AddrAdd(&AddrDynstrStart, i * cbDynSymEnt);527 pVMM->pfnDBGFR3AddrAdd(&AddrDynstrStart, i * cbDynSymEnt); 525 528 LogFlowFunc(("Found all required section start addresses (.dynsym=%RGv cSymbols=%u, .dynstr=%RGv cb=%u)\n", 526 529 AddrDynsymStart.FlatPtr, cSymbols, AddrDynstrStart.FlatPtr, 527 530 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, 529 533 pThis->AddrKernelText.FlatPtr - AddrDynstrStart.FlatPtr); 530 534 return; … … 546 550 547 551 /* Don't account incomplete entries. */ 548 DBGFR3AddrAdd(&AddrDynstrStart, (cbToRead / cbDynSymEnt) * cbDynSymEnt);552 pVMM->pfnDBGFR3AddrAdd(&AddrDynstrStart, (cbToRead / cbDynSymEnt) * cbDynSymEnt); 549 553 } 550 554 } … … 560 564 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog} 561 565 */ 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); 566 static 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 { 566 569 PDBGDIGGERFBSD pData = RT_FROM_MEMBER(pThis, DBGDIGGERFBSD, IDmesg); 570 RT_NOREF(fFlags); 567 571 568 572 if (cMessages < 1) … … 571 575 /* Resolve the message buffer address from the msgbufp symbol. */ 572 576 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); 574 578 if (RT_SUCCESS(rc)) 575 579 { … … 578 582 /* Read the message buffer pointer. */ 579 583 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)); 582 586 if (RT_FAILURE(rc)) 583 587 { … … 593 597 /* Read the structure. */ 594 598 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)); 597 601 if (RT_SUCCESS(rc)) 598 602 { … … 627 631 return VERR_INVALID_STATE; 628 632 } 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); 630 635 if (RT_SUCCESS(rc)) 631 636 { … … 704 709 * @copydoc DBGFOSREG::pfnStackUnwindAssist 705 710 */ 706 static DECLCALLBACK(int) dbgDiggerFreeBsdStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,707 P RTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,708 uint64_t *puScratch)709 { 710 RT_NOREF(pUVM, p vData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);711 static 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); 711 716 return VINF_SUCCESS; 712 717 } … … 716 721 * @copydoc DBGFOSREG::pfnQueryInterface 717 722 */ 718 static DECLCALLBACK(void *) dbgDiggerFreeBsdQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf) 719 { 720 RT_NOREF1(pUVM); 723 static DECLCALLBACK(void *) dbgDiggerFreeBsdQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf) 724 { 721 725 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; 726 RT_NOREF(pUVM, pVMM); 727 722 728 switch (enmIf) 723 729 { … … 734 740 * @copydoc DBGFOSREG::pfnQueryVersion 735 741 */ 736 static DECLCALLBACK(int) dbgDiggerFreeBsdQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 742 static DECLCALLBACK(int) dbgDiggerFreeBsdQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, 743 char *pszVersion, size_t cchVersion) 737 744 { 738 745 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; … … 740 747 741 748 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); 743 750 if (RT_SUCCESS(rc)) 744 751 { 745 752 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); 749 756 if (RT_SUCCESS(rc)) 750 757 { … … 768 775 * @copydoc DBGFOSREG::pfnTerm 769 776 */ 770 static DECLCALLBACK(void) dbgDiggerFreeBsdTerm(PUVM pUVM, void *pvData) 771 { 772 RT_NOREF1(pUVM); 777 static DECLCALLBACK(void) dbgDiggerFreeBsdTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 778 { 773 779 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; 774 780 Assert(pThis->fValid); 775 776 RT_NOREF1(pUVM); 781 RT_NOREF(pUVM, pVMM); 777 782 778 783 pThis->fValid = false; … … 783 788 * @copydoc DBGFOSREG::pfnRefresh 784 789 */ 785 static DECLCALLBACK(int) dbgDiggerFreeBsdRefresh(PUVM pUVM, void *pvData)790 static DECLCALLBACK(int) dbgDiggerFreeBsdRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 786 791 { 787 792 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; … … 789 794 Assert(pThis->fValid); 790 795 791 dbgDiggerFreeBsdTerm(pUVM, p vData);792 return dbgDiggerFreeBsdInit(pUVM, p vData);796 dbgDiggerFreeBsdTerm(pUVM, pVMM, pvData); 797 return dbgDiggerFreeBsdInit(pUVM, pVMM, pvData); 793 798 } 794 799 … … 797 802 * @copydoc DBGFOSREG::pfnInit 798 803 */ 799 static DECLCALLBACK(int) dbgDiggerFreeBsdInit(PUVM pUVM, void *pvData)804 static DECLCALLBACK(int) dbgDiggerFreeBsdInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 800 805 { 801 806 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; … … 804 809 RT_NOREF1(pUVM); 805 810 806 dbgDiggerFreeBsdProcessKernelImage(pThis, pUVM, "kernel");811 dbgDiggerFreeBsdProcessKernelImage(pThis, pUVM, pVMM, "kernel"); 807 812 pThis->fValid = true; 808 813 return VINF_SUCCESS; … … 813 818 * @copydoc DBGFOSREG::pfnProbe 814 819 */ 815 static DECLCALLBACK(bool) dbgDiggerFreeBsdProbe(PUVM pUVM, void *pvData)820 static DECLCALLBACK(bool) dbgDiggerFreeBsdProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 816 821 { 817 822 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; … … 827 832 static const uint8_t s_abNeedle[] = ELFMAG; 828 833 DBGFADDRESS KernelAddr; 829 DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64FreeBsdKernelAddresses[i]);834 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64FreeBsdKernelAddresses[i]); 830 835 DBGFADDRESS HitAddr; 831 836 uint32_t cbLeft = FBSD_MAX_KERNEL_SIZE; … … 833 838 while (cbLeft > X86_PAGE_4K_SIZE) 834 839 { 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); 837 842 if (RT_FAILURE(rc)) 838 843 break; … … 843 848 */ 844 849 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); 847 852 if (RT_SUCCESS(rc)) 848 853 { … … 858 863 AssertCompileMembersSameSizeAndOffset(Elf64_Ehdr, e_version, Elf32_Ehdr, e_version); 859 864 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); 861 866 if (RT_SUCCESS(rc)) 862 867 { … … 875 880 pThis->AddrKernelElfStart = HitAddr; 876 881 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)); 878 883 LogFunc(("Found %s FreeBSD kernel at %RGv (.interp section at %RGv, .text section at %RGv)\n", 879 884 pThis->f64Bit ? "amd64" : "i386", pThis->AddrKernelElfStart.FlatPtr, … … 892 897 893 898 cbLeft -= cbDistance; 894 DBGFR3AddrAdd(&KernelAddr, cbDistance);899 pVMM->pfnDBGFR3AddrAdd(&KernelAddr, cbDistance); 895 900 } 896 901 } … … 902 907 * @copydoc DBGFOSREG::pfnDestruct 903 908 */ 904 static DECLCALLBACK(void) dbgDiggerFreeBsdDestruct(PUVM pUVM, void *pvData)905 { 906 RT_NOREF 2(pUVM, pvData);909 static DECLCALLBACK(void) dbgDiggerFreeBsdDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 910 { 911 RT_NOREF(pUVM, pVMM, pvData); 907 912 } 908 913 … … 911 916 * @copydoc DBGFOSREG::pfnConstruct 912 917 */ 913 static DECLCALLBACK(int) dbgDiggerFreeBsdConstruct(PUVM pUVM, void *pvData) 914 { 915 RT_NOREF1(pUVM); 918 static DECLCALLBACK(int) dbgDiggerFreeBsdConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 919 { 916 920 PDBGDIGGERFBSD pThis = (PDBGDIGGERFBSD)pvData; 921 RT_NOREF(pUVM, pVMM); 917 922 918 923 pThis->fValid = false; -
trunk/src/VBox/Debugger/DBGPlugInLinux.cpp
r93115 r93470 23 23 #include "DBGPlugIns.h" 24 24 #include "DBGPlugInCommonELF.h" 25 #include <VBox/vmm/ dbgf.h>25 #include <VBox/vmm/vmmr3vtable.h> 26 26 #include <VBox/dis.h> 27 27 #include <iprt/ctype.h> … … 220 220 * Internal Functions * 221 221 *********************************************************************************************************************************/ 222 static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, void *pvData);222 static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData); 223 223 224 224 … … 246 246 * @param pThis The Linux digger data. 247 247 * @param pUVM The VM handle. 248 * @param pVMM The VMM function table. 248 249 * @param pGCPtrLogBuf Where to store the start of the kernel log buffer on success. 249 250 * @param pcbLogBuf Where to store the size of the kernel log buffer on success. 250 251 */ 251 static int dbgDiggerLinuxKrnlLogBufFindByNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf) 252 static int dbgDiggerLinuxKrnlLogBufFindByNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 253 RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf) 252 254 { 253 255 int rc = VINF_SUCCESS; … … 256 258 DBGFADDRESS AddrScan; 257 259 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); 262 264 if (RT_SUCCESS(rc)) 263 265 { … … 266 268 DBGFADDRESS AddrCur; 267 269 268 DBGFR3AddrSub(&AddrHit, sizeof(LNXPRINTKHDR));270 pVMM->pfnDBGFR3AddrSub(&AddrHit, sizeof(LNXPRINTKHDR)); 269 271 AddrCur = AddrHit; 270 272 … … 276 278 277 279 LNXPRINTKHDR Hdr; 278 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrCur, &Hdr, sizeof(Hdr));280 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrCur, &Hdr, sizeof(Hdr)); 279 281 if (RT_SUCCESS(rc)) 280 282 { … … 294 296 295 297 cbLogBuf += Hdr.cbTotal; 296 DBGFR3AddrAdd(&AddrCur, Hdr.cbTotal);298 pVMM->pfnDBGFR3AddrAdd(&AddrCur, Hdr.cbTotal); 297 299 } 298 300 … … 360 362 * @param pThis The Linux digger data. 361 363 * @param pUVM The VM handle. 364 * @param pVMM The VMM function table. 362 365 * @param hMod The module to use. 363 366 * @param pszSymbol The symbol of the getter. … … 365 368 * @param cbVal Size of the value in bytes. 366 369 */ 367 static int dbgDiggerLinuxDisassembleSimpleGetter(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,370 static int dbgDiggerLinuxDisassembleSimpleGetter(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod, 368 371 const char *pszSymbol, void *pvVal, uint32_t cbVal) 369 372 { … … 391 394 DBGFADDRESS Addr; 392 395 RTGCPTR GCPtrCur = (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr + offInstr; 393 DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur);396 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur); 394 397 395 398 /* Prefetch the instruction. */ 396 399 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)); 398 401 if (RT_SUCCESS(rc)) 399 402 { … … 444 447 445 448 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); 449 452 } 450 453 } … … 473 476 * @param pThis The Linux digger data. 474 477 * @param pUVM The VM handle. 478 * @param pVMM The VMM function table. 475 479 * @param hMod The module to use. 476 480 * @param pGCPtrLogBuf Where to store the log buffer pointer on success. 477 481 * @param pcbLogBuf Where to store the size of the log buffer on success. 478 482 */ 479 static int dbgDiggerLinuxQueryAsciiLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,483 static int dbgDiggerLinuxQueryAsciiLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod, 480 484 RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf) 481 485 { … … 522 526 DBGFADDRESS Addr; 523 527 RTGCPTR GCPtrCur = (RTGCPTR)SymInfo.Value + pThis->AddrKernelBase.FlatPtr + offInstr; 524 DBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur);528 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, GCPtrCur); 525 529 526 530 /* Prefetch the instruction. */ 527 531 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)); 529 533 if (RT_SUCCESS(rc)) 530 534 { … … 574 578 union { uint8_t abVal[8]; uint32_t u32Val; uint64_t u64Val; } Val; 575 579 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); 579 584 if (RT_SUCCESS(rc)) 580 585 { … … 697 702 * @param pThis The Linux digger data. 698 703 * @param pUVM The VM handle. 704 * @param pVMM The VMM function table. 699 705 * @param hMod The module to use. 700 706 * @param pGCPtrLogBuf Where to store the log buffer pointer on success. 701 707 * @param pcbLogBuf Where to store the size of the log buffer on success. 702 708 */ 703 static int dbgDiggerLinuxQueryLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,709 static int dbgDiggerLinuxQueryLogBufferPtrs(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod, 704 710 RTGCPTR *pGCPtrLogBuf, uint32_t *pcbLogBuf) 705 711 { … … 715 721 RT_BZERO(aSymbols[i].pvVar, aSymbols[i].cbHost); 716 722 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, 718 724 aSymbols[i].pvVar, aSymbols[i].cbGuest); 719 725 } … … 729 735 * @param pThis The Linux digger data. 730 736 * @param pUVM The user mode VM handle. 731 */ 732 static bool dbgDiggerLinuxLogBufferIsAsciiBuffer(PDBGDIGGERLINUX pThis, PUVM pUVM) 737 * @param pVMM The VMM function table. 738 */ 739 static bool dbgDiggerLinuxLogBufferIsAsciiBuffer(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM) 733 740 { 734 741 char szTmp[128]; … … 736 743 737 744 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); 739 746 if ( RT_SUCCESS(rc) 740 747 && RTStrVersionCompare(pszVer, "3.4") == -1) … … 750 757 * @param pThis The Linux digger data. 751 758 * @param pUVM The VM user mdoe handle. 759 * @param pVMM The VMM function table. 752 760 * @param hMod The debug module handle. 753 761 * @param fFlags Flags reserved for future use, MBZ. … … 760 768 * holds the necessary buffer size. Optional. 761 769 */ 762 static int dbgDiggerLinuxLogBufferQueryAscii(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,770 static int dbgDiggerLinuxLogBufferQueryAscii(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod, 763 771 uint32_t fFlags, uint32_t cMessages, 764 772 char *pszBuf, size_t cbBuf, size_t *pcbActual) … … 783 791 Assert(aSymbols[i].cbHost >= aSymbols[i].cbGuest); 784 792 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); 788 797 if (RT_SUCCESS(rc)) 789 798 continue; … … 804 813 if (rc == VERR_NOT_FOUND) 805 814 { 806 rc = dbgDiggerLinuxQueryAsciiLogBufferPtrs(pThis, pUVM, hMod, &GCPtrLogBuf, &cbLogBuf);815 rc = dbgDiggerLinuxQueryAsciiLogBufferPtrs(pThis, pUVM, pVMM, hMod, &GCPtrLogBuf, &cbLogBuf); 807 816 if (RT_FAILURE(rc)) 808 817 return rc; … … 835 844 } 836 845 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); 838 847 if (RT_FAILURE(rc)) 839 848 { … … 865 874 * @param pThis The Linux digger data. 866 875 * @param pUVM The VM user mode handle. 876 * @param pVMM The VMM function table. 867 877 * @param GCPtrLogBuf Flat guest address of the start of the log buffer. 868 878 * @param cbLogBuf Power of two aligned size of the log buffer. … … 878 888 * holds the necessary buffer size. Optional. 879 889 */ 880 static int dbgDiggerLinuxKrnLogBufferProcess(PDBGDIGGERLINUX pThis, PUVM pUVM, RTGCPTR GCPtrLogBuf,890 static int dbgDiggerLinuxKrnLogBufferProcess(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTGCPTR GCPtrLogBuf, 881 891 uint32_t cbLogBuf, uint32_t idxFirst, uint32_t idxNext, 882 892 uint32_t fFlags, uint32_t cMessages, char *pszBuf, size_t cbBuf, … … 924 934 } 925 935 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); 927 937 if (RT_FAILURE(rc)) 928 938 { … … 1061 1071 * @param pThis The Linux digger data. 1062 1072 * @param pUVM The VM user mdoe handle. 1073 * @param pVMM The VMM function table. 1063 1074 * @param hMod The debug module handle. 1064 1075 * @param fFlags Flags reserved for future use, MBZ. … … 1071 1082 * holds the necessary buffer size. Optional. 1072 1083 */ 1073 static int dbgDiggerLinuxLogBufferQueryRecords(PDBGDIGGERLINUX pThis, PUVM pUVM, RTDBGMOD hMod,1084 static int dbgDiggerLinuxLogBufferQueryRecords(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hMod, 1074 1085 uint32_t fFlags, uint32_t cMessages, 1075 1086 char *pszBuf, size_t cbBuf, size_t *pcbActual) … … 1097 1108 Assert(aSymbols[i].cbHost >= aSymbols[i].cbGuest); 1098 1109 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); 1102 1114 if (RT_SUCCESS(rc)) 1103 1115 continue; … … 1120 1132 idxFirst = 0; 1121 1133 idxNext = 0; 1122 rc = dbgDiggerLinuxQueryLogBufferPtrs(pThis, pUVM, hMod, &GCPtrLogBuf, &cbLogBuf);1134 rc = dbgDiggerLinuxQueryLogBufferPtrs(pThis, pUVM, pVMM, hMod, &GCPtrLogBuf, &cbLogBuf); 1123 1135 if (RT_FAILURE(rc)) 1124 1136 { … … 1127 1139 * and try to deduce the boundaries from there. 1128 1140 */ 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, 1135 1146 fFlags, cMessages, pszBuf, cbBuf, pcbActual); 1136 1147 } … … 1139 1150 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog} 1140 1151 */ 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)1152 static 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) 1143 1154 { 1144 1155 PDBGDIGGERLINUX pData = RT_FROM_MEMBER(pThis, DBGDIGGERLINUX, IDmesg); … … 1150 1161 * Resolve the symbols we need and read their values. 1151 1162 */ 1152 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);1163 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 1153 1164 RTDBGMOD hMod; 1154 1165 int rc = RTDbgAsModuleByName(hAs, "vmlinux", 0, &hMod); … … 1164 1175 * see: http://thread.gmane.org/gmane.linux.kernel/1284184 1165 1176 */ 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); 1168 1179 else 1169 rc = dbgDiggerLinuxLogBufferQueryRecords(pData, pUVM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual);1180 rc = dbgDiggerLinuxLogBufferQueryRecords(pData, pUVM, pVMM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual); 1170 1181 1171 1182 /* Release the module in any case. */ … … 1178 1189 * require any symbols, try that here. 1179 1190 */ 1180 if (!dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM ))1191 if (!dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM, pVMM)) 1181 1192 { 1182 1193 RTGCPTR GCPtrLogBuf = 0; 1183 1194 uint32_t cbLogBuf = 0; 1184 1195 1185 rc = dbgDiggerLinuxKrnlLogBufFindByNeedle(pData, pUVM, &GCPtrLogBuf, &cbLogBuf);1196 rc = dbgDiggerLinuxKrnlLogBufFindByNeedle(pData, pUVM, pVMM, &GCPtrLogBuf, &cbLogBuf); 1186 1197 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*/, 1188 1199 fFlags, cMessages, pszBuf, cbBuf, &cbActual); 1189 1200 } … … 1249 1260 * @copydoc DBGFOSREG::pfnStackUnwindAssist 1250 1261 */ 1251 static DECLCALLBACK(int) dbgDiggerLinuxStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,1252 P RTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,1253 uint64_t *puScratch)1254 { 1255 RT_NOREF(pUVM, p vData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);1262 static 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); 1256 1267 return VINF_SUCCESS; 1257 1268 } … … 1261 1272 * @copydoc DBGFOSREG::pfnQueryInterface 1262 1273 */ 1263 static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf) 1264 { 1265 RT_NOREF1(pUVM); 1274 static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf) 1275 { 1266 1276 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; 1277 RT_NOREF(pUVM, pVMM); 1278 1267 1279 switch (enmIf) 1268 1280 { … … 1279 1291 * @copydoc DBGFOSREG::pfnQueryVersion 1280 1292 */ 1281 static DECLCALLBACK(int) dbgDiggerLinuxQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 1293 static DECLCALLBACK(int) dbgDiggerLinuxQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, 1294 char *pszVersion, size_t cchVersion) 1282 1295 { 1283 1296 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 1287 1300 * It's all in the linux banner. 1288 1301 */ 1289 int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);1302 int rc = pVMM->pfnDBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion); 1290 1303 if (RT_SUCCESS(rc)) 1291 1304 { … … 1307 1320 * @copydoc DBGFOSREG::pfnTerm 1308 1321 */ 1309 static DECLCALLBACK(void) dbgDiggerLinuxTerm(PUVM pUVM, void *pvData)1322 static DECLCALLBACK(void) dbgDiggerLinuxTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1310 1323 { 1311 1324 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 1320 1333 * Unlink and release our modules. 1321 1334 */ 1322 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);1335 RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 1323 1336 if (hDbgAs != NIL_RTDBGAS) 1324 1337 { … … 1347 1360 * @copydoc DBGFOSREG::pfnRefresh 1348 1361 */ 1349 static DECLCALLBACK(int) dbgDiggerLinuxRefresh(PUVM pUVM, void *pvData)1362 static DECLCALLBACK(int) dbgDiggerLinuxRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1350 1363 { 1351 1364 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; 1352 NOREF(pThis);1365 RT_NOREF(pThis); 1353 1366 Assert(pThis->fValid); 1354 1367 … … 1356 1369 * For now we'll flush and reload everything. 1357 1370 */ 1358 dbgDiggerLinuxTerm(pUVM, p vData);1359 return dbgDiggerLinuxInit(pUVM, p vData);1371 dbgDiggerLinuxTerm(pUVM, pVMM, pvData); 1372 return dbgDiggerLinuxInit(pUVM, pVMM, pvData); 1360 1373 } 1361 1374 … … 1367 1380 * @returns VINF_SUCCESS. 1368 1381 * @param pThis The Linux digger data to update. 1382 * @param pVMM The VMM function table. 1369 1383 * @param pAddrKernelNames The kallsyms_names address. 1370 1384 * @param cKernelSymbols The number of kernel symbol. 1371 1385 * @param cbAddress The guest address size. 1372 1386 */ 1373 static int dbgDiggerLinuxFoundStartOfNames(PDBGDIGGERLINUX pThis, PC DBGFADDRESS pAddrKernelNames,1387 static int dbgDiggerLinuxFoundStartOfNames(PDBGDIGGERLINUX pThis, PCVMMR3VTABLE pVMM, PCDBGFADDRESS pAddrKernelNames, 1374 1388 uint32_t cKernelSymbols, uint32_t cbAddress) 1375 1389 { … … 1389 1403 && (pThis->cKernelSymbols & 1)) 1390 1404 cbAlign = sizeof(int32_t); 1391 DBGFR3AddrSub(&pThis->AddrKernelAddresses, cKernelSymbols * cbOffsets + cbSymbolsSkip + cbAlign);1405 pVMM->pfnDBGFR3AddrSub(&pThis->AddrKernelAddresses, cKernelSymbols * cbOffsets + cbSymbolsSkip + cbAlign); 1392 1406 1393 1407 Log(("dbgDiggerLinuxFoundStartOfNames: AddrKernelAddresses=%RGv\n" … … 1412 1426 * been found and taken down. 1413 1427 * @param pUVM The user mode VM handle. 1428 * @param pVMM The VMM function table. 1414 1429 * @param pThis The Linux digger data. 1415 1430 * @param pHitAddr An address we think is inside kallsyms_names. 1416 1431 */ 1417 static int dbgDiggerLinuxFindStartOfNamesAndSymbolCount(PUVM pUVM, PDBGDIGGERLINUX pThis, PCDBGFADDRESS pHitAddr) 1432 static int dbgDiggerLinuxFindStartOfNamesAndSymbolCount(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis, 1433 PCDBGFADDRESS pHitAddr) 1418 1434 { 1419 1435 /* … … 1429 1445 uint32_t cbBuf = pHitAddr->FlatPtr & (sizeof(uBuf) - 1); 1430 1446 DBGFADDRESS CurAddr = *pHitAddr; 1431 DBGFR3AddrSub(&CurAddr, cbBuf);1447 pVMM->pfnDBGFR3AddrSub(&CurAddr, cbBuf); 1432 1448 cbBuf += sizeof(uint64_t) - 1; /* In case our kobj hit is in the first 4/8 bytes. */ 1433 1449 for (;;) 1434 1450 { 1435 int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));1451 int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf)); 1436 1452 if (RT_FAILURE(rc)) 1437 1453 return rc; … … 1509 1525 DBGFADDRESS RelAddr = CurAddr; 1510 1526 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)); 1513 1531 if ( RT_SUCCESS(rc) 1514 1532 && LNX64_VALID_ADDRESS(uKrnlRelBase + aiRelOff[0]) … … 1520 1538 pThis->fRelKrnlAddr = true; 1521 1539 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)), 1524 1542 (uint32_t)uBuf.au64[i], sizeof(uint64_t)); 1525 1543 } … … 1529 1547 && (i <= 1 || LNX64_VALID_ADDRESS(uBuf.au64[i - 2])) 1530 1548 && (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)), 1533 1551 (uint32_t)uBuf.au64[i], sizeof(uint64_t)); 1534 1552 } … … 1557 1575 pThis->fRelKrnlAddr = true; 1558 1576 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)), 1561 1579 uBuf.au32[i], sizeof(uint32_t)); 1562 1580 } … … 1566 1584 && (i <= 1 || LNX32_VALID_ADDRESS(uBuf.au32[i - 2])) 1567 1585 && (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)), 1570 1588 uBuf.au32[i], sizeof(uint32_t)); 1571 1589 } … … 1582 1600 } 1583 1601 cbLeft -= sizeof(uBuf); 1584 DBGFR3AddrSub(&CurAddr, sizeof(uBuf));1602 pVMM->pfnDBGFR3AddrSub(&CurAddr, sizeof(uBuf)); 1585 1603 cbBuf = sizeof(uBuf); 1586 1604 } … … 1593 1611 * @returns VINF_SUCCESS 1594 1612 * @param pThis The linux digger data to update. 1613 * @param pVMM The VMM function table. 1595 1614 * @param pAddrMarkers The address of the marker (kallsyms_markers). 1596 1615 * @param cbMarkerEntry The size of a marker entry (32-bit or 64-bit). 1597 1616 */ 1598 static int dbgDiggerLinuxFoundMarkers(PDBGDIGGERLINUX pThis, PCDBGFADDRESS pAddrMarkers, uint32_t cbMarkerEntry) 1617 static int dbgDiggerLinuxFoundMarkers(PDBGDIGGERLINUX pThis, PCVMMR3VTABLE pVMM, 1618 PCDBGFADDRESS pAddrMarkers, uint32_t cbMarkerEntry) 1599 1619 { 1600 1620 pThis->cbKernelNames = pAddrMarkers->FlatPtr - pThis->AddrKernelNames.FlatPtr; … … 1602 1622 pThis->cKernelNameMarkers = RT_ALIGN_32(pThis->cKernelSymbols, 256) / 256; 1603 1623 pThis->AddrKernelTokenTable = *pAddrMarkers; 1604 DBGFR3AddrAdd(&pThis->AddrKernelTokenTable, pThis->cKernelNameMarkers * cbMarkerEntry);1624 pVMM->pfnDBGFR3AddrAdd(&pThis->AddrKernelTokenTable, pThis->cKernelNameMarkers * cbMarkerEntry); 1605 1625 1606 1626 Log(("dbgDiggerLinuxFoundMarkers: AddrKernelNames=%RGv cbKernelNames=%#x\n" … … 1626 1646 * been found and taken down. 1627 1647 * @param pUVM The user mode VM handle. 1648 * @param pVMM The VMM function table. 1628 1649 * @param pThis The Linux digger data. 1629 1650 * @param pHitAddr An address we think is inside kallsyms_names. 1630 1651 */ 1631 static int dbgDiggerLinuxFindEndOfNamesAndMore(PUVM pUVM, P DBGDIGGERLINUX pThis, PCDBGFADDRESS pHitAddr)1652 static int dbgDiggerLinuxFindEndOfNamesAndMore(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis, PCDBGFADDRESS pHitAddr) 1632 1653 { 1633 1654 /* … … 1644 1665 uint32_t offBuf = pHitAddr->FlatPtr & (sizeof(uBuf) - 1); 1645 1666 DBGFADDRESS CurAddr = *pHitAddr; 1646 DBGFR3AddrSub(&CurAddr, offBuf);1667 pVMM->pfnDBGFR3AddrSub(&CurAddr, offBuf); 1647 1668 for (;;) 1648 1669 { 1649 int rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf));1670 int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &CurAddr, &uBuf, sizeof(uBuf)); 1650 1671 if (RT_FAILURE(rc)) 1651 1672 return rc; … … 1678 1699 && uBuf.au64[0] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256 1679 1700 && 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)); 1681 1703 1682 1704 uint32_t const cEntries = sizeof(uBuf) / sizeof(uint64_t); … … 1691 1713 if ( uBuf.au64[i + 1] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256 1692 1714 && 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)); 1694 1717 } 1695 1718 } … … 1699 1722 && uBuf.au32[0] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256 1700 1723 && 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)); 1702 1726 1703 1727 uint32_t const cEntries = sizeof(uBuf) / sizeof(uint32_t); … … 1712 1736 if ( uBuf.au32[i + 1] >= (LNX_MIN_KALLSYMS_ENC_LENGTH + 1) * 256 1713 1737 && 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)); 1715 1740 } 1716 1741 } … … 1725 1750 } 1726 1751 cbLeft -= sizeof(uBuf); 1727 DBGFR3AddrAdd(&CurAddr, sizeof(uBuf));1752 pVMM->pfnDBGFR3AddrAdd(&CurAddr, sizeof(uBuf)); 1728 1753 offBuf = 0; 1729 1754 } … … 1739 1764 * @returns VBox status code. 1740 1765 * @param pUVM The user mode VM handle. 1766 * @param pVMM The VMM function table. 1741 1767 * @param pThis The Linux digger data. 1742 1768 */ 1743 static int dbgDiggerLinuxFindTokenIndex(PUVM pUVM, P DBGDIGGERLINUX pThis)1769 static int dbgDiggerLinuxFindTokenIndex(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis) 1744 1770 { 1745 1771 /* … … 1756 1782 } uBuf; 1757 1783 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)); 1759 1785 if (RT_FAILURE(rc)) 1760 1786 return rc; … … 1789 1815 { 1790 1816 pThis->AddrKernelTokenIndex = CurAddr; 1791 DBGFR3AddrAdd(&pThis->AddrKernelTokenIndex, i * sizeof(uint16_t));1817 pVMM->pfnDBGFR3AddrAdd(&pThis->AddrKernelTokenIndex, i * sizeof(uint16_t)); 1792 1818 pThis->cbKernelTokenTable = i * sizeof(uint16_t); 1793 1819 return VINF_SUCCESS; … … 1805 1831 * @returns VBox status code. 1806 1832 * @param pUVM The user mode VM handle. 1833 * @param pVMM The VMM function table. 1807 1834 * @param pThis The Linux digger data. 1808 1835 * @param uKernelStart Flat kernel start address. … … 1811 1838 * relative to the start of the kernel. 1812 1839 */ 1813 static int dbgDiggerLinuxLoadKernelSymbolsWorker(PUVM pUVM, P DBGDIGGERLINUX pThis, RTGCUINTPTR uKernelStart,1840 static int dbgDiggerLinuxLoadKernelSymbolsWorker(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis, RTGCUINTPTR uKernelStart, 1814 1841 RTGCUINTPTR cbKernel, RTGCUINTPTR *pauSymOff) 1815 1842 { 1816 1843 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); 1818 1845 if (RT_SUCCESS(rc)) 1819 1846 { 1820 1847 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); 1822 1849 if (RT_SUCCESS(rc)) 1823 1850 { 1824 1851 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)); 1826 1853 if (RT_SUCCESS(rc)) 1827 1854 { … … 1915 1942 if (RT_SUCCESS(rc)) 1916 1943 { 1917 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);1944 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 1918 1945 if (hAs != NIL_RTDBGAS) 1919 1946 rc = RTDbgAsModuleLink(hAs, hMod, uKernelStart, RTDBGASLINK_FLAGS_REPLACE); … … 1952 1979 * @returns VBox status code. 1953 1980 * @param pUVM The user mode VM handle. 1981 * @param pVMM The VMM function table. 1954 1982 * @param pThis The Linux digger data. 1955 1983 */ 1956 static int dbgDiggerLinuxLoadKernelSymbolsAbsolute(PUVM pUVM, P DBGDIGGERLINUX pThis)1984 static int dbgDiggerLinuxLoadKernelSymbolsAbsolute(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis) 1957 1985 { 1958 1986 /* … … 1961 1989 uint32_t const cbGuestAddr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t); 1962 1990 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); 1964 1993 if (RT_SUCCESS(rc)) 1965 1994 { … … 2010 2039 RTGCUINTPTR cbKernel = uKernelEnd - uKernelStart; 2011 2040 pThis->cbKernel = (uint32_t)cbKernel; 2012 DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart);2041 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart); 2013 2042 Log(("dbgDiggerLinuxLoadKernelSymbolsAbsolute: uKernelStart=%RGv cbKernel=%#x\n", uKernelStart, cbKernel)); 2014 2043 2015 rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, p This, uKernelStart, cbKernel, pauSymOff);2044 rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, pVMM, pThis, uKernelStart, cbKernel, pauSymOff); 2016 2045 if (RT_FAILURE(rc)) 2017 2046 Log(("dbgDiggerLinuxLoadKernelSymbolsAbsolute: Loading symbols from given offset table failed: %Rrc\n", rc)); … … 2032 2061 * @returns VBox status code. 2033 2062 * @param pUVM The user mode VM handle. 2063 * @param pVMM The VMM function table. 2034 2064 * @param pThis The Linux digger data. 2035 2065 */ 2036 static int dbgDiggerLinuxLoadKernelSymbolsRelative(PUVM pUVM, P DBGDIGGERLINUX pThis)2066 static int dbgDiggerLinuxLoadKernelSymbolsRelative(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis) 2037 2067 { 2038 2068 /* … … 2040 2070 */ 2041 2071 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)); 2043 2074 if (RT_SUCCESS(rc)) 2044 2075 { … … 2076 2107 RTGCUINTPTR cbKernel = uKernelEnd - uKernelStart; 2077 2108 pThis->cbKernel = (uint32_t)cbKernel; 2078 DBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart);2109 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrKernelBase, uKernelStart); 2079 2110 Log(("dbgDiggerLinuxLoadKernelSymbolsRelative: uKernelStart=%RGv cbKernel=%#x\n", uKernelStart, cbKernel)); 2080 2111 2081 rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, p This, uKernelStart, cbKernel, pauSymOff);2112 rc = dbgDiggerLinuxLoadKernelSymbolsWorker(pUVM, pVMM, pThis, uKernelStart, cbKernel, pauSymOff); 2082 2113 if (RT_FAILURE(rc)) 2083 2114 Log(("dbgDiggerLinuxLoadKernelSymbolsRelative: Loading symbols from given offset table failed: %Rrc\n", rc)); … … 2098 2129 * @returns VBox status code. 2099 2130 * @param pUVM The user mode VM handle. 2131 * @param pVMM The VMM function table. 2100 2132 * @param pThis The Linux digger data. 2101 2133 */ 2102 static int dbgDiggerLinuxLoadKernelSymbols(PUVM pUVM, P DBGDIGGERLINUX pThis)2134 static int dbgDiggerLinuxLoadKernelSymbols(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERLINUX pThis) 2103 2135 { 2104 2136 /* … … 2106 2138 */ 2107 2139 if (pThis->fRelKrnlAddr) 2108 return dbgDiggerLinuxLoadKernelSymbolsRelative(pUVM, p This);2109 return dbgDiggerLinuxLoadKernelSymbolsAbsolute(pUVM, p This);2140 return dbgDiggerLinuxLoadKernelSymbolsRelative(pUVM, pVMM, pThis); 2141 return dbgDiggerLinuxLoadKernelSymbolsAbsolute(pUVM, pVMM, pThis); 2110 2142 } 2111 2143 … … 2133 2165 uint32_t uVersion; 2134 2166 bool f64Bit; 2135 uint64_t (*pfnProcessModule)(PDBGDIGGERLINUX pThis, PUVM pUVM, P DBGFADDRESS pAddrModule);2167 uint64_t (*pfnProcessModule)(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGFADDRESS pAddrModule); 2136 2168 } g_aModVersions[] = 2137 2169 { … … 2156 2188 * @param pThis The Linux digger data. 2157 2189 * @param pUVM The user mode VM handle. 2158 */ 2159 static int dbgDiggerLinuxLoadModules(PDBGDIGGERLINUX pThis, PUVM pUVM) 2190 * @param pVMM The VMM function table. 2191 */ 2192 static int dbgDiggerLinuxLoadModules(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM) 2160 2193 { 2161 2194 /* 2162 2195 * Locate the list head. 2163 2196 */ 2164 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);2197 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 2165 2198 RTDBGSYMBOL SymInfo; 2166 2199 int rc = RTDbgAsSymbolByName(hAs, "vmlinux!modules", &SymInfo, NULL); … … 2184 2217 } uListAnchor; 2185 2218 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)); 2188 2221 if (RT_FAILURE(rc)) 2189 2222 { … … 2229 2262 uint64_t uModAddr = uListAnchor.u64Pair[0]; 2230 2263 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)); 2232 2265 2233 2266 return VINF_SUCCESS; … … 2240 2273 * @returns true if it's a likely fragment, false if not. 2241 2274 * @param pUVM The user mode VM handle. 2275 * @param pVMM The VMM function table. 2242 2276 * @param pHitAddr The address where paNeedle was found. 2243 2277 * @param pabNeedle The fragment we've been searching for. 2244 2278 * @param cbNeedle The length of the fragment. 2245 2279 */ 2246 static bool dbgDiggerLinuxIsLikelyNameFragment(PUVM pUVM, PCDBGFADDRESS pHitAddr, uint8_t const *pabNeedle, uint8_t cbNeedle) 2280 static bool dbgDiggerLinuxIsLikelyNameFragment(PUVM pUVM, PCVMMR3VTABLE pVMM, PCDBGFADDRESS pHitAddr, 2281 uint8_t const *pabNeedle, uint8_t cbNeedle) 2247 2282 { 2248 2283 /* … … 2269 2304 uint8_t abBuf[32]; 2270 2305 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); 2273 2308 if (RT_SUCCESS(rc)) 2274 2309 { … … 2299 2334 * @param pThis The Linux digger data. 2300 2335 * @param pUVM The user mode VM handle. 2336 * @param pVMM The VMM function table. 2301 2337 * @param pabNeedle The needle to use for searching. 2302 2338 * @param cbNeedle Size of the needle in bytes. 2303 2339 */ 2304 static int dbgDiggerLinuxFindSymbolTableFromNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, uint8_t const *pabNeedle, uint8_t cbNeedle) 2305 { 2306 int rc = VINF_SUCCESS; 2307 2340 static int dbgDiggerLinuxFindSymbolTableFromNeedle(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 2341 uint8_t const *pabNeedle, uint8_t cbNeedle) 2342 { 2308 2343 /* 2309 2344 * Go looking for the kallsyms table. If it's there, it will be somewhere 2310 2345 * after the linux_banner symbol, so use it for starting the search. 2311 2346 */ 2347 int rc = VINF_SUCCESS; 2312 2348 DBGFADDRESS CurAddr = pThis->AddrLinuxBanner; 2313 2349 uint32_t cbLeft = LNX_MAX_KERNEL_SIZE; … … 2315 2351 { 2316 2352 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); 2319 2355 if (RT_FAILURE(rc)) 2320 2356 break; 2321 if (dbgDiggerLinuxIsLikelyNameFragment(pUVM, &HitAddr, pabNeedle, cbNeedle))2357 if (dbgDiggerLinuxIsLikelyNameFragment(pUVM, pVMM, &HitAddr, pabNeedle, cbNeedle)) 2322 2358 { 2323 2359 /* 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); 2327 2363 if ( RT_SUCCESS(rc) 2328 && dbgDiggerLinuxIsLikelyNameFragment(pUVM, &HitAddr, pabNeedle, cbNeedle))2364 && dbgDiggerLinuxIsLikelyNameFragment(pUVM, pVMM, &HitAddr, pabNeedle, cbNeedle)) 2329 2365 { 2330 2366 /* … … 2333 2369 * kallsyms_num_syms is aligned on sizeof(unsigned long) boundrary 2334 2370 */ 2335 rc = dbgDiggerLinuxFindStartOfNamesAndSymbolCount(pUVM, p This, &HitAddr);2371 rc = dbgDiggerLinuxFindStartOfNamesAndSymbolCount(pUVM, pVMM, pThis, &HitAddr); 2336 2372 if (RT_SUCCESS(rc)) 2337 rc = dbgDiggerLinuxFindEndOfNamesAndMore(pUVM, p This, &HitAddr);2373 rc = dbgDiggerLinuxFindEndOfNamesAndMore(pUVM, pVMM, pThis, &HitAddr); 2338 2374 if (RT_SUCCESS(rc)) 2339 rc = dbgDiggerLinuxFindTokenIndex(pUVM, p This);2375 rc = dbgDiggerLinuxFindTokenIndex(pUVM, pVMM, pThis); 2340 2376 if (RT_SUCCESS(rc)) 2341 rc = dbgDiggerLinuxLoadKernelSymbols(pUVM, p This);2377 rc = dbgDiggerLinuxLoadKernelSymbols(pUVM, pVMM, pThis); 2342 2378 if (RT_SUCCESS(rc)) 2343 2379 { 2344 rc = dbgDiggerLinuxLoadModules(pThis, pUVM );2380 rc = dbgDiggerLinuxLoadModules(pThis, pUVM, pVMM); 2345 2381 break; 2346 2382 } … … 2358 2394 } 2359 2395 cbLeft -= cbDistance; 2360 DBGFR3AddrAdd(&CurAddr, cbDistance); 2361 2396 pVMM->pfnDBGFR3AddrAdd(&CurAddr, cbDistance); 2362 2397 } 2363 2398 … … 2666 2701 * @param pThis The Linux digger data. 2667 2702 * @param pUVM The user mode VM handle. 2703 * @param pVMM The VMM function table. 2668 2704 * @param pAddrStart The start address of the compressed config. 2669 2705 * @param cbCfgComp The size of the compressed config. 2670 2706 */ 2671 static int dbgDiggerLinuxCfgDecode(PDBGDIGGERLINUX pThis, PUVM pUVM, 2707 static int dbgDiggerLinuxCfgDecode(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 2672 2708 PCDBGFADDRESS pAddrStart, size_t cbCfgComp) 2673 2709 { … … 2677 2713 return VERR_NO_MEMORY; 2678 2714 2679 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrStart, pbCfgComp, cbCfgComp);2715 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pAddrStart, pbCfgComp, cbCfgComp); 2680 2716 if (RT_SUCCESS(rc)) 2681 2717 { … … 2703 2739 * @param pThis The Linux digger data. 2704 2740 * @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 */ 2743 static int dbgDiggerLinuxCfgFind(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM) 2744 { 2710 2745 /* 2711 2746 * Go looking for the IKCFG_ST string which indicates the start … … 2714 2749 static const uint8_t s_abCfgNeedleStart[] = "IKCFG_ST"; 2715 2750 static const uint8_t s_abCfgNeedleEnd[] = "IKCFG_ED"; 2751 int rc = VINF_SUCCESS; 2716 2752 DBGFADDRESS CurAddr = pThis->AddrLinuxBanner; 2717 2753 uint32_t cbLeft = LNX_MAX_KERNEL_SIZE; … … 2719 2755 { 2720 2756 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); 2723 2759 if (RT_FAILURE(rc)) 2724 2760 break; 2725 2761 2726 2762 /* 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); 2728 2764 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); 2731 2767 if (RT_SUCCESS(rc)) 2732 2768 { … … 2734 2770 RTGCUINTPTR cbCfg = HitAddrEnd.FlatPtr - HitAddrStart.FlatPtr; 2735 2771 Assert(cbCfg == (size_t)cbCfg); 2736 rc = dbgDiggerLinuxCfgDecode(pThis, pUVM, &HitAddrStart, cbCfg);2772 rc = dbgDiggerLinuxCfgDecode(pThis, pUVM, pVMM, &HitAddrStart, cbCfg); 2737 2773 if (RT_SUCCESS(rc)) 2738 2774 break; … … 2749 2785 } 2750 2786 cbLeft -= cbDistance; 2751 DBGFR3AddrAdd(&CurAddr, cbDistance); 2752 2787 pVMM->pfnDBGFR3AddrAdd(&CurAddr, cbDistance); 2753 2788 } 2754 2789 … … 2762 2797 * @param pThis The Linux digger data. 2763 2798 * @param pUVM The user mode VM handle. 2799 * @param pVMM The VMM function table. 2764 2800 * @param uAddrStart The address to start scanning at. 2765 2801 * @param cbScan How much to scan. 2766 2802 */ 2767 static bool dbgDiggerLinuxProbeWithAddr(PDBGDIGGERLINUX pThis, PUVM pUVM, RTGCUINTPTR uAddrStart, size_t cbScan) 2803 static bool dbgDiggerLinuxProbeWithAddr(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 2804 RTGCUINTPTR uAddrStart, size_t cbScan) 2768 2805 { 2769 2806 /* … … 2772 2809 */ 2773 2810 DBGFADDRESS KernelAddr; 2774 DBGFR3AddrFromFlat(pUVM, &KernelAddr, uAddrStart);2811 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, uAddrStart); 2775 2812 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); 2778 2815 if (RT_SUCCESS(rc)) 2779 2816 { 2780 2817 char szTmp[128]; 2781 2818 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)); 2783 2820 if ( RT_SUCCESS(rc) 2784 2821 && ( ( pszX[0] == '2' /* 2.x.y with x in {0..6} */ … … 2809 2846 * @param pThis The Linux digger data. 2810 2847 * @param pUVM The user mode VM handle. 2811 */ 2812 static bool dbgDiggerLinuxProbeKaslr(PDBGDIGGERLINUX pThis, PUVM pUVM) 2848 * @param pVMM The VMM function table. 2849 */ 2850 static bool dbgDiggerLinuxProbeKaslr(PDBGDIGGERLINUX pThis, PUVM pUVM, PCVMMR3VTABLE pVMM) 2813 2851 { 2814 2852 /** … … 2837 2875 * So the highest offset the kernel can start is 0x40000000 which is 1GB (plus the maximum kernel size we defined). 2838 2876 */ 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)) 2840 2878 return true; 2841 2879 … … 2846 2884 * The default split is 3GB userspace and 1GB kernel, so we just search the entire upper 1GB kernel space. 2847 2885 */ 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)) 2849 2887 return true; 2850 2888 … … 2855 2893 * @copydoc DBGFOSREG::pfnInit 2856 2894 */ 2857 static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, void *pvData)2895 static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 2858 2896 { 2859 2897 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 2861 2899 2862 2900 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)); 2864 2902 if (RT_SUCCESS(rc)) 2865 2903 { … … 2911 2949 * the method to use. 2912 2950 */ 2913 rc = dbgDiggerLinuxCfgFind(pThis, pUVM );2951 rc = dbgDiggerLinuxCfgFind(pThis, pUVM, pVMM); 2914 2952 if (RT_FAILURE(rc)) 2915 2953 LogFlowFunc(("Failed to find kernel config (%Rrc), no config database available\n", rc)); 2916 2954 2917 2955 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); 2919 2957 if (RT_FAILURE(rc)) 2920 2958 { 2921 2959 /* Try alternate needle (seen on older x86 Linux kernels). */ 2922 2960 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); 2924 2962 if (RT_FAILURE(rc)) 2925 2963 { 2926 2964 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); 2928 2966 } 2929 2967 } … … 2937 2975 * @copydoc DBGFOSREG::pfnProbe 2938 2976 */ 2939 static DECLCALLBACK(bool) dbgDiggerLinuxProbe(PUVM pUVM, void *pvData)2977 static DECLCALLBACK(bool) dbgDiggerLinuxProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 2940 2978 { 2941 2979 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 2943 2981 for (unsigned i = 0; i < RT_ELEMENTS(g_au64LnxKernelAddresses); i++) 2944 2982 { 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)) 2946 2984 return true; 2947 2985 } 2948 2986 2949 2987 /* Maybe the kernel uses KASLR. */ 2950 if (dbgDiggerLinuxProbeKaslr(pThis, pUVM ))2988 if (dbgDiggerLinuxProbeKaslr(pThis, pUVM, pVMM)) 2951 2989 return true; 2952 2990 … … 2958 2996 * @copydoc DBGFOSREG::pfnDestruct 2959 2997 */ 2960 static DECLCALLBACK(void) dbgDiggerLinuxDestruct(PUVM pUVM, void *pvData)2961 { 2962 RT_NOREF 2(pUVM, pvData);2998 static DECLCALLBACK(void) dbgDiggerLinuxDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 2999 { 3000 RT_NOREF(pUVM, pVMM, pvData); 2963 3001 } 2964 3002 … … 2967 3005 * @copydoc DBGFOSREG::pfnConstruct 2968 3006 */ 2969 static DECLCALLBACK(int) dbgDiggerLinuxConstruct(PUVM pUVM, void *pvData)2970 { 2971 RT_NOREF 1(pUVM);3007 static DECLCALLBACK(int) dbgDiggerLinuxConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 3008 { 3009 RT_NOREF(pUVM, pVMM); 2972 3010 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; 2973 3011 pThis->IDmesg.u32Magic = DBGFOSIDMESG_MAGIC; -
trunk/src/VBox/Debugger/DBGPlugInLinuxModuleCodeTmpl.cpp.h
r93115 r93470 395 395 * @param cSyms Number of symbols in the array. 396 396 */ 397 static int RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(PUVM pUVM, RTDBGMOD hDbgMod, LNX_PTR_T uPtrModuleStart, LNX_PTR_T uPtrSymStart, uint32_t cSyms) 397 static int RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(PUVM pUVM, PCVMMR3VTABLE pVMM, RTDBGMOD hDbgMod, 398 LNX_PTR_T uPtrModuleStart, LNX_PTR_T uPtrSymStart, uint32_t cSyms) 398 399 { 399 400 int rc = VINF_SUCCESS; 400 401 DBGFADDRESS AddrSym; 401 DBGFR3AddrFromFlat(pUVM, &AddrSym, uPtrSymStart);402 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrSym, uPtrSymStart); 402 403 403 404 while ( cSyms … … 407 408 uint32_t cThisLoad = RT_MIN(cSyms, RT_ELEMENTS(aSyms)); 408 409 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])); 410 411 if (RT_SUCCESS(rc)) 411 412 { 412 413 cSyms -= cThisLoad; 413 DBGFR3AddrAdd(&AddrSym, cThisLoad * sizeof(aSyms[0]));414 pVMM->pfnDBGFR3AddrAdd(&AddrSym, cThisLoad * sizeof(aSyms[0])); 414 415 415 416 for (uint32_t i = 0; i < cThisLoad; i++) … … 417 418 char szSymName[128]; 418 419 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)); 421 422 if (RT_FAILURE(rc)) 422 423 break; … … 428 429 429 430 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); 431 433 if (RT_SUCCESS(rc)) 432 434 LogFlowFunc(("Added symbol '%s' successfully\n", szSymName)); … … 447 449 * Version specific module processing code. 448 450 */ 449 static uint64_t RT_CONCAT(dbgDiggerLinuxLoadModule,LNX_SUFFIX)(PDBGDIGGERLINUX pThis, PUVM pUVM, PDBGFADDRESS pAddrModule) 451 static uint64_t RT_CONCAT(dbgDiggerLinuxLoadModule,LNX_SUFFIX)(PDBGDIGGERLINUX pThis, PUVM pUVM, 452 PCVMMR3VTABLE pVMM, PDBGFADDRESS pAddrModule) 450 453 { 451 454 RT_CONCAT(LNXKMODULE,LNX_SUFFIX) Module; 452 455 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)); 455 459 if (RT_FAILURE(rc)) 456 460 { … … 495 499 if (RT_SUCCESS(rc)) 496 500 { 497 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);501 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 498 502 rc = RTDbgAsModuleLink(hAs, hDbgMod, uPtrModuleCore, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/); 499 503 RTDbgAsRelease(hAs); 500 504 if (RT_SUCCESS(rc)) 501 505 { 502 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,506 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore, 503 507 Module.uPtrSyms, Module.num_syms); 504 508 if (RT_FAILURE(rc)) … … 506 510 507 511 #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, 509 513 Module.uPtrGplSyms, Module.num_gpl_syms); 510 514 if (RT_FAILURE(rc)) … … 513 517 514 518 #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, 516 520 Module.uPtrGplFutureSyms, Module.num_gpl_future_syms); 517 521 if (RT_FAILURE(rc)) … … 520 524 521 525 #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, 523 527 Module.uPtrUnusedSyms, Module.num_unused_syms); 524 528 if (RT_FAILURE(rc)) 525 529 LogRelFunc((" Faild to load unused symbols: %Rrc\n", rc)); 526 530 527 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, hDbgMod, uPtrModuleCore,531 rc = RT_CONCAT(dbgDiggerLinuxLoadModuleSymbols,LNX_SUFFIX)(pUVM, pVMM, hDbgMod, uPtrModuleCore, 528 532 Module.uPtrUnusedGplSyms, Module.num_unused_gpl_syms); 529 533 if (RT_FAILURE(rc)) -
trunk/src/VBox/Debugger/DBGPlugInOS2.cpp
r93115 r93470 22 22 #define LOG_GROUP LOG_GROUP_DBGF /// @todo add new log group. 23 23 #include "DBGPlugIns.h" 24 #include <VBox/vmm/ dbgf.h>24 #include <VBox/vmm/vmmr3vtable.h> 25 25 #include <VBox/err.h> 26 26 #include <VBox/param.h> … … 51 51 /** The user-mode VM handle for use in info handlers. */ 52 52 PUVM pUVM; 53 /** The VMM function table for use in info handlers. */ 54 PCVMMR3VTABLE pVMM; 53 55 54 56 /** Whether the information is valid or not. … … 408 410 * Internal Functions * 409 411 *********************************************************************************************************************************/ 410 static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, void *pvData);412 static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData); 411 413 412 414 … … 415 417 { 416 418 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); 418 420 if (RT_SUCCESS(rc)) 419 421 { … … 447 449 { 448 450 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); 452 457 if (RT_FAILURE(rc)) 453 458 { … … 467 472 }; 468 473 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)); 470 476 if (RT_FAILURE(rc)) 471 477 { … … 511 517 * Info data. 512 518 */ 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)); 515 522 if (RT_SUCCESS(rc)) 516 523 { … … 535 542 { 536 543 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; 539 549 int rc = dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, pThis->selGis, UINT32_MAX, 0, "Global info segment", &SelInfo); 540 550 if (RT_FAILURE(rc)) … … 547 557 OS2GIS Gis; 548 558 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)); 551 561 if (RT_FAILURE(rc)) 552 562 { … … 591 601 { 592 602 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; 595 608 int rc = dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, pThis->Lis.sel, pThis->Lis.off, 19, "Local info segment", &SelInfo); 596 609 if (RT_FAILURE(rc)) … … 603 616 OS2LIS Lis; 604 617 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)); 607 620 if (RT_FAILURE(rc)) 608 621 { … … 639 652 { 640 653 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); 645 661 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); 648 664 /** @todo support pre-2001 kernels w/o the module/drivce name. */ 649 665 if (RT_SUCCESS(rc)) … … 651 667 char szMsg[728 + 1]; 652 668 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); 654 670 if (szMsg[0] != '\0') 655 671 { … … 681 697 * @copydoc DBGFOSREG::pfnStackUnwindAssist 682 698 */ 683 static DECLCALLBACK(int) dbgDiggerOS2StackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,684 P RTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,685 uint64_t *puScratch)686 { 687 RT_NOREF(pUVM, p vData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);699 static 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); 688 704 return VINF_SUCCESS; 689 705 } … … 693 709 * @copydoc DBGFOSREG::pfnQueryInterface 694 710 */ 695 static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)696 { 697 RT_NOREF 3(pUVM, pvData, enmIf);711 static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf) 712 { 713 RT_NOREF(pUVM, pVMM, pvData, enmIf); 698 714 return NULL; 699 715 } … … 703 719 * @copydoc DBGFOSREG::pfnQueryVersion 704 720 */ 705 static DECLCALLBACK(int) dbgDiggerOS2QueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)706 { 707 RT_NOREF1(pUVM); 721 static DECLCALLBACK(int) dbgDiggerOS2QueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, 722 char *pszVersion, size_t cchVersion) 723 { 708 724 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; 725 RT_NOREF(pUVM, pVMM); 709 726 Assert(pThis->fValid); 727 710 728 char *achOS2ProductType[32]; 711 729 char *pszOS2ProductType = (char *)achOS2ProductType; … … 748 766 * @copydoc DBGFOSREG::pfnTerm 749 767 */ 750 static DECLCALLBACK(void) dbgDiggerOS2Term(PUVM pUVM, void *pvData) 751 { 752 RT_NOREF1(pUVM); 768 static DECLCALLBACK(void) dbgDiggerOS2Term(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 769 { 753 770 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; 754 771 Assert(pThis->fValid); 755 772 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"); 760 777 761 778 pThis->fValid = false; … … 766 783 * @copydoc DBGFOSREG::pfnRefresh 767 784 */ 768 static DECLCALLBACK(int) dbgDiggerOS2Refresh(PUVM pUVM, void *pvData)785 static DECLCALLBACK(int) dbgDiggerOS2Refresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 769 786 { 770 787 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 775 792 * For now we'll flush and reload everything. 776 793 */ 777 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);794 RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 778 795 if (hDbgAs != NIL_RTDBGAS) 779 796 { … … 795 812 } 796 813 797 dbgDiggerOS2Term(pUVM, p vData);798 return dbgDiggerOS2Init(pUVM, p vData);814 dbgDiggerOS2Term(pUVM, pVMM, pvData); 815 return dbgDiggerOS2Init(pUVM, pVMM, pvData); 799 816 } 800 817 … … 847 864 848 865 849 static void dbgdiggerOS2ProcessModule(PUVM pUVM, P DBGDIGGEROS2 pThis, DBGDIGGEROS2BUF *pBuf,866 static void dbgdiggerOS2ProcessModule(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGEROS2 pThis, DBGDIGGEROS2BUF *pBuf, 850 867 const char *pszCacheSubDir, RTDBGAS hAs, RTDBGCFG hDbgCfg) 851 868 { … … 877 894 */ 878 895 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)); 880 898 if (RT_FAILURE(rc)) 881 899 { … … 900 918 { 901 919 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); 903 922 szModPath[cbToRead] = '\0'; 904 923 } … … 922 941 * Read the object table into the buffer. 923 942 */ 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); 926 945 if (RT_FAILURE(rc)) 927 946 { … … 1036 1055 * @copydoc DBGFOSREG::pfnInit 1037 1056 */ 1038 static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, void *pvData)1057 static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1039 1058 { 1040 1059 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 1049 1068 */ 1050 1069 /* 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); 1052 1071 if (RT_FAILURE(rc)) 1053 1072 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)); 1055 1074 if (RT_FAILURE(rc)) 1056 1075 return VERR_NOT_SUPPORTED; … … 1064 1083 * Try use SAS to find the module list. 1065 1084 */ 1066 rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);1085 rc = pVMM->pfnDBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00); 1067 1086 if (RT_SUCCESS(rc)) 1068 1087 { 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)); 1070 1089 if (RT_SUCCESS(rc)) 1071 1090 { 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); 1073 1092 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)); 1075 1094 if (RT_SUCCESS(rc)) 1076 1095 { … … 1078 1097 * Work the module list. 1079 1098 */ 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])); 1082 1101 if (RT_SUCCESS(rc)) 1083 1102 { 1084 1103 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); 1087 1106 1088 1107 char szCacheSubDir[24]; 1089 1108 RTStrPrintf(szCacheSubDir, sizeof(szCacheSubDir), "os2-%u.%u", pThis->OS2MajorVersion, pThis->OS2MinorVersion); 1090 1109 1091 DBGFR3AddrFromFlat(pUVM, &Addr, uBuf.au32[0]);1110 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uBuf.au32[0]); 1092 1111 while (Addr.FlatPtr != 0 && Addr.FlatPtr != UINT32_MAX) 1093 1112 { 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)); 1095 1114 if (RT_FAILURE(rc)) 1096 1115 break; … … 1100 1119 uOs2Krnl = (uint32_t)Addr.FlatPtr; 1101 1120 1102 DBGFR3AddrFromFlat(pUVM, &Addr, uBuf.mte.mte_link);1103 dbgdiggerOS2ProcessModule(pUVM, p This, &uBuf, szCacheSubDir, hAs, hDbgCfg);1121 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, uBuf.mte.mte_link); 1122 dbgdiggerOS2ProcessModule(pUVM, pVMM, pThis, &uBuf, szCacheSubDir, hAs, hDbgCfg); 1104 1123 } 1105 1124 … … 1108 1127 if (uOs2Krnl != UINT32_MAX) 1109 1128 { 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)); 1112 1131 if (RT_SUCCESS(rc)) 1113 1132 { 1114 1133 LogRel(("DbgDiggerOs2: Module @ %#010RX32: %.8s %#x %#x [again]\n", (uint32_t)Addr.FlatPtr, 1115 1134 uBuf.mte.mte_modname, uBuf.mte.mte_flags1, uBuf.mte.mte_flags2)); 1116 dbgdiggerOS2ProcessModule(pUVM, p This, &uBuf, szCacheSubDir, hAs, hDbgCfg);1135 dbgdiggerOS2ProcessModule(pUVM, pVMM, pThis, &uBuf, szCacheSubDir, hAs, hDbgCfg); 1117 1136 } 1118 1137 } … … 1127 1146 * Register info handlers. 1128 1147 */ 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); 1133 1152 1134 1153 return VINF_SUCCESS; … … 1139 1158 * @copydoc DBGFOSREG::pfnProbe 1140 1159 */ 1141 static DECLCALLBACK(bool) dbgDiggerOS2Probe(PUVM pUVM, void *pvData)1160 static DECLCALLBACK(bool) dbgDiggerOS2Probe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1142 1161 { 1143 1162 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 1154 1173 1155 1174 /* 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. 1157 1176 * Note: The SAS layout is similar between 16-bit and 32-bit OS/2, but not identical. 1158 1177 * 32-bit OS/2 will have the flat kernel data selector at SAS:06. The selector is 168h … … 1162 1181 */ 1163 1182 do { 1164 rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);1183 rc = pVMM->pfnDBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00); 1165 1184 if (RT_FAILURE(rc)) 1166 1185 break; 1167 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256);1186 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256); 1168 1187 if (RT_FAILURE(rc)) 1169 1188 break; … … 1200 1219 * @copydoc DBGFOSREG::pfnDestruct 1201 1220 */ 1202 static DECLCALLBACK(void) dbgDiggerOS2Destruct(PUVM pUVM, void *pvData)1203 { 1204 RT_NOREF 2(pUVM, pvData);1221 static DECLCALLBACK(void) dbgDiggerOS2Destruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1222 { 1223 RT_NOREF(pUVM, pVMM, pvData); 1205 1224 } 1206 1225 … … 1209 1228 * @copydoc DBGFOSREG::pfnConstruct 1210 1229 */ 1211 static DECLCALLBACK(int) dbgDiggerOS2Construct(PUVM pUVM, void *pvData) 1212 { 1213 RT_NOREF1(pUVM); 1230 static DECLCALLBACK(int) dbgDiggerOS2Construct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1231 { 1214 1232 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; 1215 1233 pThis->fValid = false; … … 1217 1235 pThis->enmVer = DBGDIGGEROS2VER_UNKNOWN; 1218 1236 pThis->pUVM = pUVM; 1237 pThis->pVMM = pVMM; 1219 1238 return VINF_SUCCESS; 1220 1239 } -
trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp
r93115 r93470 24 24 #include "DBGPlugInCommonELF.h" 25 25 #include <VBox/vmm/dbgf.h> 26 #include <VBox/vmm/vmmr3vtable.h> 26 27 #include <iprt/asm.h> 27 28 #include <iprt/err.h> … … 351 352 * Internal Functions * 352 353 *********************************************************************************************************************************/ 353 static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, void *pvData);354 static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData); 354 355 355 356 … … 358 359 * @copydoc DBGFOSREG::pfnStackUnwindAssist 359 360 */ 360 static DECLCALLBACK(int) dbgDiggerSolarisStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,361 P RTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,362 uint64_t *puScratch)363 { 364 RT_NOREF(pUVM, p vData, idCpu, pFrame, pState, pInitialCtx, hAs, puScratch);361 static 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); 365 366 return VINF_SUCCESS; 366 367 } … … 370 371 * @copydoc DBGFOSREG::pfnQueryInterface 371 372 */ 372 static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)373 { 374 RT_NOREF 3(pUVM, pvData, enmIf);373 static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf) 374 { 375 RT_NOREF(pUVM, pVMM, pvData, enmIf); 375 376 return NULL; 376 377 } … … 380 381 * @copydoc DBGFOSREG::pfnQueryVersion 381 382 */ 382 static DECLCALLBACK(int) dbgDiggerSolarisQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 383 static DECLCALLBACK(int) dbgDiggerSolarisQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, 384 char *pszVersion, size_t cchVersion) 383 385 { 384 386 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 392 394 DBGFADDRESS Addr; 393 395 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); 395 397 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)); 397 400 if (RT_FAILURE(rc)) 398 401 { … … 402 405 memset(&UtsName, '\0', sizeof(UtsName)); 403 406 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); 406 409 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)); 409 413 } 410 414 … … 442 446 * @param pModCtl Pointer to the modctl structure. 443 447 */ 444 static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, P DBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)448 static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl) 445 449 { 446 450 RT_NOREF1(pThis); … … 461 465 char szModName[64]; 462 466 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)); 464 469 if (RT_FAILURE(rc)) 465 470 return; … … 469 474 AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_filename, v9_32.mod_filename); 470 475 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)); 472 478 if (RT_FAILURE(rc)) 473 479 strcpy(szFilename, szModName); … … 480 486 AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_mp, v9_32.mod_mp); 481 487 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)); 483 489 if (RT_FAILURE(rc)) 484 490 return; … … 550 556 if (!paShdrs) 551 557 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); 553 559 if (RT_SUCCESS(rc)) 554 560 { … … 556 562 if (pvSymSpace) 557 563 { 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); 559 566 if (RT_SUCCESS(rc)) 560 567 { … … 571 578 cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms); 572 579 573 DBGDiggerCommonParseElf32Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,580 DBGDiggerCommonParseElf32Mod(pUVM, pVMM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS, 574 581 &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings, 575 582 SOL32_MIN_KRNL_ADDR, SOL32_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG); … … 591 598 * @param pModCtl Pointer to the modctl structure. 592 599 */ 593 static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, P DBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)600 static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl) 594 601 { 595 602 RT_NOREF1(pThis); … … 610 617 char szModName[64]; 611 618 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)); 613 621 if (RT_FAILURE(rc)) 614 622 return; … … 618 626 AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_filename, v9_64.mod_filename); 619 627 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)); 621 630 if (RT_FAILURE(rc)) 622 631 strcpy(szFilename, szModName); … … 629 638 AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_mp, v9_64.mod_mp); 630 639 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)); 632 641 if (RT_FAILURE(rc)) 633 642 return; … … 698 707 if (!paShdrs) 699 708 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); 701 710 if (RT_SUCCESS(rc)) 702 711 { … … 704 713 if (pvSymSpace) 705 714 { 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); 707 717 if (RT_SUCCESS(rc)) 708 718 { … … 719 729 cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms); 720 730 721 DBGDiggerCommonParseElf64Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,731 DBGDiggerCommonParseElf64Mod(pUVM, pVMM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS, 722 732 &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings, 723 733 SOL64_MIN_KRNL_ADDR, SOL64_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG); … … 735 745 * @copydoc DBGFOSREG::pfnTerm 736 746 */ 737 static DECLCALLBACK(void) dbgDiggerSolarisTerm(PUVM pUVM, void *pvData) 738 { 739 RT_NOREF1(pUVM); 747 static DECLCALLBACK(void) dbgDiggerSolarisTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 748 { 740 749 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; 750 RT_NOREF(pUVM, pVMM); 741 751 Assert(pThis->fValid); 742 752 … … 748 758 * @copydoc DBGFOSREG::pfnRefresh 749 759 */ 750 static DECLCALLBACK(int) dbgDiggerSolarisRefresh(PUVM pUVM, void *pvData)760 static DECLCALLBACK(int) dbgDiggerSolarisRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 751 761 { 752 762 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; 753 NOREF(pThis);763 RT_NOREF(pThis); 754 764 Assert(pThis->fValid); 755 765 … … 757 767 * For now we'll flush and reload everything. 758 768 */ 759 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);769 RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 760 770 if (hDbgAs != NIL_RTDBGAS) 761 771 { … … 777 787 } 778 788 779 dbgDiggerSolarisTerm(pUVM, p vData);780 return dbgDiggerSolarisInit(pUVM, p vData);789 dbgDiggerSolarisTerm(pUVM, pVMM, pvData); 790 return dbgDiggerSolarisInit(pUVM, pVMM, pvData); 781 791 } 782 792 … … 785 795 * @copydoc DBGFOSREG::pfnInit 786 796 */ 787 static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, void *pvData)797 static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 788 798 { 789 799 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 795 805 * On Solaris the kernel and is the global address space. 796 806 */ 797 DBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);807 pVMM->pfnDBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL); 798 808 799 809 /** @todo Use debug_info, build 7x / S10U6. */ … … 803 813 * We know it resides in the unix data segment. 804 814 */ 805 DBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0);815 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0); 806 816 807 817 DBGFADDRESS CurAddr = pThis->AddrUnixData; 808 818 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); 810 820 const uint8_t *pbExpr = (const uint8_t *)&pThis->AddrUnixText.FlatPtr; 811 821 const uint32_t cbExpr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t); … … 814 824 { 815 825 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); 817 827 if (RT_FAILURE(rc)) 818 828 break; … … 826 836 if (pThis->f64Bit) 827 837 { 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)); 829 839 SOL64v11_modctl_t ModCtlv11; 830 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));840 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11)); 831 841 if (RT_SUCCESS(rc)) 832 842 { … … 848 858 char szUnix[5]; 849 859 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)); 852 862 if (RT_SUCCESS(rc)) 853 863 { … … 866 876 else 867 877 { 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)); 869 879 SOL32v11_modctl_t ModCtlv11; 870 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));880 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11)); 871 881 if (RT_SUCCESS(rc)) 872 882 { … … 888 898 char szUnix[5]; 889 899 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)); 892 902 if (RT_SUCCESS(rc)) 893 903 { … … 908 918 if (pThis->f64Bit) 909 919 { 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)); 911 921 SOL64v9_modctl_t ModCtlv9; 912 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));922 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9)); 913 923 if (RT_SUCCESS(rc)) 914 924 { … … 928 938 char szUnix[5]; 929 939 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)); 932 942 if (RT_SUCCESS(rc)) 933 943 { … … 946 956 else 947 957 { 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)); 949 959 SOL32v9_modctl_t ModCtlv9; 950 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));960 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9)); 951 961 if (RT_SUCCESS(rc)) 952 962 { … … 966 976 char szUnix[5]; 967 977 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)); 970 980 if (RT_SUCCESS(rc)) 971 981 { … … 984 994 985 995 /* next */ 986 DBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr);996 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr); 987 997 } 988 998 … … 998 1008 /* read it */ 999 1009 SOL_modctl_t ModCtl; 1000 rc = DBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl);1010 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl); 1001 1011 if (RT_FAILURE(rc)) 1002 1012 { … … 1007 1017 /* process it. */ 1008 1018 if (pThis->f64Bit) 1009 dbgDiggerSolarisProcessModCtl64(pUVM, p This, &ModCtl);1019 dbgDiggerSolarisProcessModCtl64(pUVM, pVMM, pThis, &ModCtl); 1010 1020 else 1011 dbgDiggerSolarisProcessModCtl32(pUVM, p This, &ModCtl);1021 dbgDiggerSolarisProcessModCtl32(pUVM, pVMM, pThis, &ModCtl); 1012 1022 1013 1023 /* next */ … … 1020 1030 break; 1021 1031 } 1022 DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next);1032 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next); 1023 1033 } 1024 1034 else … … 1030 1040 break; 1031 1041 } 1032 DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next);1042 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next); 1033 1043 } 1034 1044 if (++iMod >= 1024) … … 1048 1058 * @copydoc DBGFOSREG::pfnProbe 1049 1059 */ 1050 static DECLCALLBACK(bool) dbgDiggerSolarisProbe(PUVM pUVM, void *pvData)1060 static DECLCALLBACK(bool) dbgDiggerSolarisProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1051 1061 { 1052 1062 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 1059 1069 1060 1070 /* 32-bit search range. */ 1061 DBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000);1071 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000); 1062 1072 RTGCUINTPTR cbRange = 0xfec00000 - 0xfe800000; 1063 1073 1064 1074 DBGFADDRESS HitAddr; 1065 1075 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); 1067 1077 if (RT_FAILURE(rc)) 1068 1078 { 1069 1079 /* 64-bit.... */ 1070 DBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000));1080 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000)); 1071 1081 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); 1073 1083 if (RT_FAILURE(rc)) 1074 1084 return false; … … 1081 1091 static const uint8_t s_abSMI[] = "Sun Microsystems, Inc."; 1082 1092 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); 1084 1094 if (RT_FAILURE(rc)) 1085 1095 { 1086 1096 /* 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); 1088 1098 if (RT_FAILURE(rc)) 1089 1099 return false; … … 1094 1104 */ 1095 1105 pThis->AddrUnixText = Addr; 1096 DBGFR3AddrAdd(&Addr, SOL_UNIX_MAX_CODE_SEG_SIZE);1106 pVMM->pfnDBGFR3AddrAdd(&Addr, SOL_UNIX_MAX_CODE_SEG_SIZE); 1097 1107 pThis->AddrUnixData = Addr; 1098 1108 pThis->f64Bit = f64Bit; … … 1105 1115 * @copydoc DBGFOSREG::pfnDestruct 1106 1116 */ 1107 static DECLCALLBACK(void) dbgDiggerSolarisDestruct(PUVM pUVM, void *pvData) 1108 { 1109 RT_NOREF2(pUVM, pvData); 1110 1117 static DECLCALLBACK(void) dbgDiggerSolarisDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1118 { 1119 RT_NOREF(pUVM, pVMM, pvData); 1111 1120 } 1112 1121 … … 1115 1124 * @copydoc DBGFOSREG::pfnConstruct 1116 1125 */ 1117 static DECLCALLBACK(int) dbgDiggerSolarisConstruct(PUVM pUVM, void *pvData)1118 { 1119 RT_NOREF 2(pUVM, pvData);1126 static DECLCALLBACK(int) dbgDiggerSolarisConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1127 { 1128 RT_NOREF(pUVM, pVMM, pvData); 1120 1129 return VINF_SUCCESS; 1121 1130 } -
trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp
r93115 r93470 25 25 #include <VBox/vmm/cpumctx.h> 26 26 #include <VBox/vmm/mm.h> 27 #include <VBox/vmm/vmmr3vtable.h> 27 28 #include <VBox/err.h> 28 29 #include <VBox/param.h> … … 321 322 * Internal Functions * 322 323 *********************************************************************************************************************************/ 323 static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, void *pvData);324 static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData); 324 325 325 326 … … 341 342 * @param pThis The instance data. 342 343 * @param pUVM The user mode VM handle. 343 */ 344 static void dbgDiggerWinNtResolveKpcr(PDBGDIGGERWINNT pThis, PUVM pUVM) 344 * @param pVMM The VMM function table. 345 */ 346 static void dbgDiggerWinNtResolveKpcr(PDBGDIGGERWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM) 345 347 { 346 348 /* … … 352 354 * match what we expect. 353 355 */ 354 VMCPUID cCpus = DBGFR3CpuGetCount(pUVM);356 VMCPUID cCpus = pVMM->pfnDBGFR3CpuGetCount(pUVM); 355 357 pThis->paKpcrAddr = (PDBGFADDRESS)RTMemAllocZ(cCpus * 2 * sizeof(DBGFADDRESS)); 356 358 if (RT_LIKELY(pThis->paKpcrAddr)) … … 370 372 uint32_t GCPtrKpcrBase = 0; 371 373 372 rc = DBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_FS_BASE, &GCPtrKpcrBase);374 rc = pVMM->pfnDBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_FS_BASE, &GCPtrKpcrBase); 373 375 if ( RT_SUCCESS(rc) 374 376 && WINNT32_VALID_ADDRESS(GCPtrKpcrBase)) … … 394 396 395 397 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)); 399 401 if (RT_SUCCESS(rc)) 400 402 { … … 402 404 uint32_t GCPtrIdt = 0; 403 405 404 rc = DBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_GDTR_BASE, &GCPtrGdt);406 rc = pVMM->pfnDBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_GDTR_BASE, &GCPtrGdt); 405 407 if (RT_SUCCESS(rc)) 406 rc = DBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_IDTR_BASE, &GCPtrIdt);408 rc = pVMM->pfnDBGFR3RegCpuQueryU32(pUVM, idCpu, DBGFREG_IDTR_BASE, &GCPtrIdt); 407 409 if (RT_SUCCESS(rc)) 408 410 { … … 411 413 && Kpcr.GCPtrSelf == pKpcrAddr->FlatPtr) 412 414 { 413 DBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb);415 pVMM->pfnDBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb); 414 416 LogRel(("DigWinNt/KPCR[%u]: KPCR=%RGv KPCRB=%RGv\n", idCpu, pKpcrAddr->FlatPtr, pKpcrbAddr->FlatPtr)); 415 417 … … 428 430 DBGFADDRESS AddrKdVersBlock; 429 431 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)); 432 434 if (RT_SUCCESS(rc)) 433 435 pThis->NtBuildNumber = KdVersBlock.MinorVersion; … … 449 451 /* Read GS base which points to the base of the KPCR for each CPU. */ 450 452 RTGCUINTPTR GCPtrTmp = 0; 451 rc = DBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_GS_BASE, &GCPtrTmp);453 rc = pVMM->pfnDBGFR3RegCpuQueryU64(pUVM, idCpu, DBGFREG_GS_BASE, &GCPtrTmp); 452 454 if ( RT_SUCCESS(rc) 453 455 && !WINNT64_VALID_ADDRESS(GCPtrTmp)) … … 457 459 * read the GS kernel base MSR instead. 458 460 */ 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); 460 462 } 461 463 … … 464 466 { 465 467 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); 469 471 if (RT_SUCCESS(rc)) 470 472 { … … 482 484 } Kpcr; 483 485 484 rc = DBGFR3MemRead(pUVM, idCpu, pKpcrAddr, &Kpcr, sizeof(Kpcr));486 rc = pVMM->pfnDBGFR3MemRead(pUVM, idCpu, pKpcrAddr, &Kpcr, sizeof(Kpcr)); 485 487 if (RT_SUCCESS(rc)) 486 488 { … … 489 491 /** @todo && TSS */ ) 490 492 { 491 DBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb);493 pVMM->pfnDBGFR3AddrFromFlat(pUVM, pKpcrbAddr, Kpcr.GCPtrCurrentPrcb); 492 494 LogRel(("DigWinNt/KPCR[%u]: KPCR=%RGv KPCRB=%RGv\n", idCpu, pKpcrAddr->FlatPtr, pKpcrbAddr->FlatPtr)); 493 495 } … … 525 527 * @param pThis The instance data. 526 528 * @param pUVM The user mode VM handle. 529 * @param pVMM The VMM function table. 527 530 * @param pszName The module name. 528 531 * @param pszFilename The image filename. … … 530 533 * @param cbImage The size of the image. 531 534 */ 532 static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, const char *pszName, const char *pszFilename,533 PCDBGFADDRESS pImageAddr, uint32_t cbImage)535 static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszName, 536 const char *pszFilename, PCDBGFADDRESS pImageAddr, uint32_t cbImage) 534 537 { 535 538 LogFlow(("DigWinNt: %RGp %#x %s\n", pImageAddr->FlatPtr, cbImage, pszName)); … … 550 553 RTERRINFOSTATIC ErrInfo; 551 554 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)); 555 558 if (RT_SUCCESS(rc)) 556 559 { … … 564 567 * Link the module. 565 568 */ 566 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);569 RTDBGAS hAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 567 570 if (hAs != NIL_RTDBGAS) 568 571 rc = RTDbgAsModuleLink(hAs, hDbgMod, pImageAddr->FlatPtr, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/); … … 627 630 * @interface_method_impl{DBGFOSIWINNT,pfnQueryVersion} 628 631 */ 629 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryVersion(struct DBGFOSIWINNT *pThis, PUVM pUVM, 632 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryVersion(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 630 633 uint32_t *puVersMajor, uint32_t *puVersMinor, 631 634 uint32_t *puBuildNumber, bool *pf32Bit) 632 635 { 633 RT_NOREF(pUVM);634 636 PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt); 637 RT_NOREF(pUVM, pVMM); 635 638 636 639 if (puVersMajor) … … 649 652 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKernelPtrs} 650 653 */ 651 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKernelPtrs(struct DBGFOSIWINNT *pThis, PUVM pUVM, 654 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKernelPtrs(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 652 655 PRTGCUINTPTR pGCPtrKernBase, PRTGCUINTPTR pGCPtrPsLoadedModuleList) 653 656 { 654 RT_NOREF(pUVM);655 657 PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt); 658 RT_NOREF(pUVM, pVMM); 656 659 657 660 *pGCPtrKernBase = pData->KernelAddr.FlatPtr; … … 664 667 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKpcrForVCpu} 665 668 */ 666 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,667 PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb)669 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 670 VMCPUID idCpu, PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb) 668 671 { 669 672 PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt); … … 672 675 return VERR_NOT_SUPPORTED; 673 676 674 AssertReturn(idCpu < DBGFR3CpuGetCount(pUVM), VERR_INVALID_PARAMETER);677 AssertReturn(idCpu < pVMM->pfnDBGFR3CpuGetCount(pUVM), VERR_INVALID_CPU_ID); 675 678 676 679 if (pKpcr) … … 685 688 * @interface_method_impl{DBGFOSIWINNT,pfnQueryCurThrdForVCpu} 686 689 */ 687 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,688 PRTGCUINTPTR pCurThrd)690 static DECLCALLBACK(int) dbgDiggerWinNtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 691 VMCPUID idCpu, PRTGCUINTPTR pCurThrd) 689 692 { 690 693 PDBGDIGGERWINNT pData = RT_FROM_MEMBER(pThis, DBGDIGGERWINNT, IWinNt); … … 693 696 return VERR_NOT_SUPPORTED; 694 697 695 AssertReturn(idCpu < DBGFR3CpuGetCount(pUVM), VERR_INVALID_PARAMETER);698 AssertReturn(idCpu < pVMM->pfnDBGFR3CpuGetCount(pUVM), VERR_INVALID_CPU_ID); 696 699 697 700 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)); 700 703 } 701 704 … … 704 707 * @copydoc DBGFOSREG::pfnStackUnwindAssist 705 708 */ 706 static DECLCALLBACK(int) dbgDiggerWinNtStackUnwindAssist(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame,707 P RTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs,708 uint64_t *puScratch)709 static DECLCALLBACK(int) dbgDiggerWinNtStackUnwindAssist(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, VMCPUID idCpu, 710 PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, 711 RTDBGAS hAs, uint64_t *puScratch) 709 712 { 710 713 Assert(pInitialCtx); … … 816 819 /* Resize the array, zeroing the extension. */ 817 820 if (pFrame->cSureRegs) 818 paSureRegs = (PDBGFREGVALEX) MMR3HeapRealloc(pFrame->paSureRegs, iReg * sizeof(paSureRegs[0]));821 paSureRegs = (PDBGFREGVALEX)pVMM->pfnMMR3HeapRealloc(pFrame->paSureRegs, iReg * sizeof(paSureRegs[0])); 819 822 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])); 821 824 AssertReturn(paSureRegs, VERR_NO_MEMORY); 822 825 … … 835 838 } 836 839 837 RT_NOREF(pUVM, p vData, idCpu, hAs, pInitialCtx, puScratch);840 RT_NOREF(pUVM, pVMM, pvData, idCpu, hAs, pInitialCtx, puScratch); 838 841 return VINF_SUCCESS; 839 842 } … … 843 846 * @copydoc DBGFOSREG::pfnQueryInterface 844 847 */ 845 static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)846 { 847 RT_NOREF(pUVM );848 static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, DBGFOSINTERFACE enmIf) 849 { 850 RT_NOREF(pUVM, pVMM); 848 851 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; 849 852 … … 861 864 * @copydoc DBGFOSREG::pfnQueryVersion 862 865 */ 863 static DECLCALLBACK(int) dbgDiggerWinNtQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 864 { 865 RT_NOREF1(pUVM); 866 static DECLCALLBACK(int) dbgDiggerWinNtQueryVersion(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData, 867 char *pszVersion, size_t cchVersion) 868 { 869 RT_NOREF(pUVM, pVMM); 866 870 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; 867 871 Assert(pThis->fValid); 872 868 873 const char *pszNtProductType; 869 874 switch (pThis->NtProductType) … … 874 879 default: pszNtProductType = ""; break; 875 880 } 881 876 882 RTStrPrintf(pszVersion, cchVersion, "%u.%u-%s%s (BuildNumber %u)", pThis->NtMajorVersion, pThis->NtMinorVersion, 877 883 pThis->f32Bit ? "x86" : "AMD64", pszNtProductType, pThis->NtBuildNumber); … … 883 889 * @copydoc DBGFOSREG::pfnTerm 884 890 */ 885 static DECLCALLBACK(void) dbgDiggerWinNtTerm(PUVM pUVM, void *pvData)891 static DECLCALLBACK(void) dbgDiggerWinNtTerm(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 886 892 { 887 893 RT_NOREF1(pUVM); … … 893 899 * we must unlink and ditch the modules we created. 894 900 */ 895 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);901 RTDBGAS hDbgAs = pVMM->pfnDBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 896 902 if (hDbgAs != NIL_RTDBGAS) 897 903 { … … 927 933 * @copydoc DBGFOSREG::pfnRefresh 928 934 */ 929 static DECLCALLBACK(int) dbgDiggerWinNtRefresh(PUVM pUVM, void *pvData)935 static DECLCALLBACK(int) dbgDiggerWinNtRefresh(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 930 936 { 931 937 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 936 942 * For now we'll flush and reload everything. 937 943 */ 938 dbgDiggerWinNtTerm(pUVM, p vData);939 940 return dbgDiggerWinNtInit(pUVM, p vData);944 dbgDiggerWinNtTerm(pUVM, pVMM, pvData); 945 946 return dbgDiggerWinNtInit(pUVM, pVMM, pvData); 941 947 } 942 948 … … 945 951 * @copydoc DBGFOSREG::pfnInit 946 952 */ 947 static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, void *pvData)953 static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 948 954 { 949 955 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 962 968 * Figure the NT version. 963 969 */ 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); 966 972 if (RT_SUCCESS(rc)) 967 973 { … … 995 1001 /* Read the validate the MTE. */ 996 1002 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)); 998 1004 if (RT_FAILURE(rc)) 999 1005 break; … … 1036 1042 /* Read the full name. */ 1037 1043 DBGFADDRESS AddrName; 1038 DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));1044 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer)); 1039 1045 uint16_t cbName = WINNT_UNION(pThis, &Mte, FullDllName.Length); 1040 1046 if (cbName < sizeof(u)) 1041 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);1047 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName); 1042 1048 else 1043 1049 rc = VERR_OUT_OF_RANGE; 1044 1050 if (RT_FAILURE(rc)) 1045 1051 { 1046 DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));1052 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer)); 1047 1053 cbName = WINNT_UNION(pThis, &Mte, BaseDllName.Length); 1048 1054 if (cbName < sizeof(u)) 1049 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);1055 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName); 1050 1056 else 1051 1057 rc = VERR_OUT_OF_RANGE; … … 1064 1070 /* Read the start of the PE image and pass it along to a worker. */ 1065 1071 DBGFADDRESS ImageAddr; 1066 DBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));1067 dbgDiggerWinNtProcessImage(pThis, pUVM, p szModName, pszFilename, &ImageAddr, cbImageMte);1072 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase)); 1073 dbgDiggerWinNtProcessImage(pThis, pUVM, pVMM, pszModName, pszFilename, &ImageAddr, cbImageMte); 1068 1074 RTStrFree(pszFilename); 1069 1075 } … … 1072 1078 /* next */ 1073 1079 AddrPrev = Addr; 1074 DBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));1080 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink)); 1075 1081 } while ( Addr.FlatPtr != pThis->KernelMteAddr.FlatPtr 1076 1082 && Addr.FlatPtr != pThis->PsLoadedModuleListAddr.FlatPtr); 1077 1083 1078 1084 /* Try resolving the KPCR and KPCRB addresses for each vCPU. */ 1079 dbgDiggerWinNtResolveKpcr(pThis, pUVM );1085 dbgDiggerWinNtResolveKpcr(pThis, pUVM, pVMM); 1080 1086 1081 1087 pThis->fValid = true; … … 1087 1093 * @copydoc DBGFOSREG::pfnProbe 1088 1094 */ 1089 static DECLCALLBACK(bool) dbgDiggerWinNtProbe(PUVM pUVM, void *pvData)1095 static DECLCALLBACK(bool) dbgDiggerWinNtProbe(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1090 1096 { 1091 1097 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 1111 1117 * NT only runs in protected or long mode. 1112 1118 */ 1113 CPUMMODE const enmMode = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/);1119 CPUMMODE const enmMode = pVMM->pfnDBGFR3CpuGetMode(pUVM, 0 /*idCpu*/); 1114 1120 if (enmMode != CPUMMODE_PROTECTED && enmMode != CPUMMODE_LONG) 1115 1121 return false; … … 1126 1132 uint64_t uIdtrBase = 0; 1127 1133 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); 1129 1135 AssertRCReturn(rc, false); 1130 1136 … … 1133 1139 return false; 1134 1140 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); 1136 1142 if (RT_FAILURE(rc)) 1137 1143 return false; … … 1167 1173 */ 1168 1174 DBGFADDRESS KernelAddr; 1169 for ( DBGFR3AddrFromFlat(pUVM, &KernelAddr, uKrnlStart);1175 for (pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, uKrnlStart); 1170 1176 KernelAddr.FlatPtr < uKrnlEnd; 1171 1177 KernelAddr.FlatPtr += PAGE_SIZE) … … 1173 1179 bool fNt31 = false; 1174 1180 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); 1177 1183 if ( rc == VERR_DBGF_MEM_NOT_FOUND 1178 1184 && enmMode != CPUMMODE_LONG) … … 1180 1186 /* NT3.1 didn't have a PAGELK section, so look for _TEXT instead. The 1181 1187 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); 1184 1190 fNt31 = true; 1185 1191 } 1186 1192 if (RT_FAILURE(rc)) 1187 1193 break; 1188 DBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & PAGE_OFFSET_MASK);1194 pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & PAGE_OFFSET_MASK); 1189 1195 1190 1196 /* MZ + PE header. */ 1191 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));1197 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u)); 1192 1198 if ( RT_SUCCESS(rc) 1193 1199 && u.MzHdr.e_magic == IMAGE_DOS_SIGNATURE … … 1214 1220 uMte.v32.SizeOfImage = !fNt31 ? pHdrs->OptionalHeader.SizeOfImage : 0; /* NT 3.1 didn't set the size. */ 1215 1221 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); 1218 1224 while (RT_SUCCESS(rc)) 1219 1225 { 1220 1226 /* check the name. */ 1221 1227 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)); 1224 1231 if ( RT_SUCCESS(rc) 1225 1232 && uMte2.v32.DllBase == uMte.v32.DllBase … … 1233 1240 ) 1234 1241 { 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); 1237 1245 u.wsz[uMte2.v32.BaseDllName.Length / 2] = '\0'; 1238 1246 if ( RT_SUCCESS(rc) … … 1242 1250 ) 1243 1251 { 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)); 1247 1256 if ( RT_SUCCESS(rc) 1248 1257 && uMte3.v32.InLoadOrderLinks.Flink == MteAddr.FlatPtr … … 1268 1277 1269 1278 /* next */ 1270 DBGFR3AddrAdd(&HitAddr, 4);1279 pVMM->pfnDBGFR3AddrAdd(&HitAddr, 4); 1271 1280 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); 1274 1283 else 1275 1284 rc = VERR_DBGF_MEM_NOT_FOUND; … … 1297 1306 DBGFADDRESS ScanAddr; 1298 1307 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); 1301 1310 while (RT_SUCCESS(rc)) 1302 1311 { 1303 1312 /* Read the start of the MTE and check some basic members. */ 1304 1313 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)); 1307 1317 if ( RT_SUCCESS(rc) 1308 1318 && uMte2.v64.DllBase == uMte.v64.DllBase … … 1317 1327 { 1318 1328 /* 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); 1321 1332 u.wsz[uMte2.v64.BaseDllName.Length / 2] = '\0'; 1322 1333 if ( RT_SUCCESS(rc) … … 1328 1339 /* Read the link entry of the previous entry in the list and check that its 1329 1340 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)); 1333 1345 if ( RT_SUCCESS(rc) 1334 1346 && uMte3.v64.InLoadOrderLinks.Flink == MteAddr.FlatPtr … … 1354 1366 1355 1367 /* next */ 1356 DBGFR3AddrAdd(&HitAddr, 8);1368 pVMM->pfnDBGFR3AddrAdd(&HitAddr, 8); 1357 1369 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); 1360 1372 else 1361 1373 rc = VERR_DBGF_MEM_NOT_FOUND; … … 1372 1384 * @copydoc DBGFOSREG::pfnDestruct 1373 1385 */ 1374 static DECLCALLBACK(void) dbgDiggerWinNtDestruct(PUVM pUVM, void *pvData)1375 { 1376 RT_NOREF 2(pUVM, pvData);1386 static DECLCALLBACK(void) dbgDiggerWinNtDestruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1387 { 1388 RT_NOREF(pUVM, pVMM, pvData); 1377 1389 } 1378 1390 … … 1381 1393 * @copydoc DBGFOSREG::pfnConstruct 1382 1394 */ 1383 static DECLCALLBACK(int) dbgDiggerWinNtConstruct(PUVM pUVM, void *pvData)1384 { 1385 RT_NOREF 1(pUVM);1395 static DECLCALLBACK(int) dbgDiggerWinNtConstruct(PUVM pUVM, PCVMMR3VTABLE pVMM, void *pvData) 1396 { 1397 RT_NOREF(pUVM, pVMM); 1386 1398 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; 1387 1399 pThis->fValid = false; -
trunk/src/VBox/Debugger/Makefile.kmk
r93468 r93470 73 73 DbgPlugInDiggers_LIBS = \ 74 74 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ 75 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \76 $(VBOX_LIB_VMM_LAZY) \77 75 $(LIB_RUNTIME) 78 76 $(call VBOX_SET_VER_INFO_DLL,DbgPlugInDiggers,VirtualBox Debugger Guest OS Digger Plug-in) … … 117 115 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDbg.dylib 118 116 $(call VBOX_SET_VER_INFO_DLL,VBoxDbg,VirtualBox Debugger GUI) 119 120 ifdef VBOX_WITH_TESTCASES121 #122 # The VBoxDbg testcase (Qt).123 #124 PROGRAMS += tstVBoxDbg125 tstVBoxDbg_TEMPLATE = VBOXQTGUIEXE126 tstVBoxDbg_USES = qt5127 tstVBoxDbg_QTTOOL = QT5128 tstVBoxDbg_QT_MODULES = Core Gui Widgets129 tstVBoxDbg_LIBS.linux += xcb130 tstVBoxDbg_LIBS.solaris += xcb131 tstVBoxDbg_LIBS.freebsd += xcb132 tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp133 tstVBoxDbg_LIBS = \134 $(LIB_VMM) \135 $(LIB_REM) \136 $(LIB_RUNTIME)137 ifeq ($(KBUILD_TARGET),win)138 tstVBoxDbg_LIBS += \139 $(PATH_STAGE_LIB)/VBoxDbg.lib140 else141 tstVBoxDbg_LIBS += \142 $(PATH_STAGE_BIN)/VBoxDbg$(VBOX_SUFF_DLL)143 endif144 endif # TESTCASES145 117 endif # Qt 146 118 -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r93115 r93470 842 842 } 843 843 844 VMMR3DECL(PCVMMR3VTABLE) VMMR3GetVTable(void) 845 { 846 return NULL; 847 } 844 848 845 849 VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM) -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r93460 r93470 1008 1008 { 1009 1009 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, 1011 1011 aDmesg.mutableRaw(), cbBuf, &cbActual); 1012 1012 … … 1017 1017 vrc = aDmesg.reserveNoThrow(cbBuf); 1018 1018 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, 1020 1020 aDmesg.mutableRaw(), cbBuf, &cbActual); 1021 1021 } -
trunk/src/VBox/VMM/VMMR3/CFGM.cpp
r93444 r93470 60 60 #include <VBox/vmm/dbgf.h> 61 61 #include <VBox/vmm/mm.h> 62 #include <VBox/vmm/vmm.h> 62 63 #include "CFGMInternal.h" 63 64 #include <VBox/vmm/vm.h> 64 65 #include <VBox/vmm/uvm.h> 65 #include <VBox/vmm/vmmr3vtable.h>66 66 #include <VBox/err.h> 67 67 -
trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp
r93115 r93470 23 23 #include <VBox/vmm/dbgf.h> 24 24 #include <VBox/vmm/mm.h> 25 #include <VBox/vmm/vmm.h> 25 26 #include "DBGFInternal.h" 26 27 #include <VBox/vmm/uvm.h> … … 116 117 if (pUVM->dbgf.s.pCurOS) 117 118 { 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); 119 120 pUVM->dbgf.s.pCurOS = NULL; 120 121 } … … 144 145 pUVM->dbgf.s.pOSHead = pOS->pNext; 145 146 if (pOS->pReg->pfnDestruct) 146 pOS->pReg->pfnDestruct(pUVM, pOS->abData);147 pOS->pReg->pfnDestruct(pUVM, VMMR3GetVTable(), pOS->abData); 147 148 148 149 PDBGFOSEMTWRAPPER pFree = pOS->pWrapperHead; … … 189 190 pOS->pReg = pReg; 190 191 191 int rc = pOS->pReg->pfnConstruct(pUVM, pOS->abData);192 int rc = pOS->pReg->pfnConstruct(pUVM, VMMR3GetVTable(), pOS->abData); 192 193 if (RT_SUCCESS(rc)) 193 194 { … … 200 201 { 201 202 if (pOS->pReg->pfnDestruct) 202 pOS->pReg->pfnDestruct(pUVM, pOS->abData);203 pOS->pReg->pfnDestruct(pUVM, VMMR3GetVTable(), pOS->abData); 203 204 MMR3HeapFree(pOS); 204 205 } … … 291 292 */ 292 293 if (fWasCurOS) 293 pOS->pReg->pfnTerm(pUVM, pOS->abData);294 pOS->pReg->pfnTerm(pUVM, VMMR3GetVTable(), pOS->abData); 294 295 if (pOS->pReg->pfnDestruct) 295 pOS->pReg->pfnDestruct(pUVM, pOS->abData);296 pOS->pReg->pfnDestruct(pUVM, VMMR3GetVTable(), pOS->abData); 296 297 297 298 PDBGFOSEMTWRAPPER pFree = pOS->pWrapperHead; … … 371 372 372 373 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)) 374 375 { 375 376 int rc; 376 377 pUVM->dbgf.s.pCurOS = pNewOS; 377 378 if (pOldOS == pNewOS) 378 rc = pNewOS->pReg->pfnRefresh(pUVM, pNewOS->abData);379 rc = pNewOS->pReg->pfnRefresh(pUVM, VMMR3GetVTable(), pNewOS->abData); 379 380 else 380 381 { 381 382 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); 384 385 } 385 386 if (pszName && cchName) … … 392 393 /* not found */ 393 394 if (pOldOS) 394 pOldOS->pReg->pfnTerm(pUVM, pOldOS->abData);395 pOldOS->pReg->pfnTerm(pUVM, VMMR3GetVTable(), pOldOS->abData); 395 396 396 397 DBGF_OS_WRITE_UNLOCK(pUVM); … … 463 464 if (pszVersion && cchVersion) 464 465 { 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); 466 468 if (RT_FAILURE(rc2) || rc == VINF_SUCCESS) 467 469 rc = rc2; … … 516 518 * @interface_method_impl{DBGFOSIDMESG,pfnQueryKernelLog, Generic EMT wrapper.} 517 519 */ 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)520 static 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) 520 522 { 521 523 PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.Dmesg); … … 529 531 530 532 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); 533 535 534 536 } … … 538 540 * @interface_method_impl{DBGFOSIWINNT,pfnQueryVersion, Generic EMT wrapper.} 539 541 */ 540 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryVersion(PDBGFOSIWINNT pThis, PUVM pUVM, uint32_t *puVersMajor, uint32_t *puVersMinor,541 uint32_t *pu BuildNumber, bool *pf32Bit)542 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryVersion(PDBGFOSIWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, uint32_t *puVersMajor, 543 uint32_t *puVersMinor, uint32_t *puBuildNumber, bool *pf32Bit) 542 544 { 543 545 PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.WinNt); … … 546 548 547 549 return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/, 548 (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryVersion, 6,549 pWrapper->uDigger.pWinNt, pUVM, p uVersMajor, puVersMinor,550 (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryVersion, 7, 551 pWrapper->uDigger.pWinNt, pUVM, pVMM, puVersMajor, puVersMinor, 550 552 puBuildNumber, pf32Bit); 551 553 } … … 555 557 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKernelPtrs, Generic EMT wrapper.} 556 558 */ 557 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKernelPtrs(PDBGFOSIWINNT pThis, PUVM pUVM, 559 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKernelPtrs(PDBGFOSIWINNT pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 558 560 PRTGCUINTPTR pGCPtrKernBase, PRTGCUINTPTR pGCPtrPsLoadedModuleList) 559 561 { … … 563 565 564 566 return VMR3ReqPriorityCallWaitU(pWrapper->pUVM, 0 /*idDstCpu*/, 565 (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryKernelPtrs, 4,566 pWrapper->uDigger.pWinNt, pUVM, p GCPtrKernBase, pGCPtrPsLoadedModuleList);567 (PFNRT)pWrapper->uDigger.pWinNt->pfnQueryKernelPtrs, 5, 568 pWrapper->uDigger.pWinNt, pUVM, pVMM, pGCPtrKernBase, pGCPtrPsLoadedModuleList); 567 569 } 568 570 … … 571 573 * @interface_method_impl{DBGFOSIWINNT,pfnQueryKpcrForVCpu, Generic EMT wrapper.} 572 574 */ 573 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,574 PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb)575 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryKpcrForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 576 VMCPUID idCpu, PRTGCUINTPTR pKpcr, PRTGCUINTPTR pKpcrb) 575 577 { 576 578 PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.WinNt); … … 579 581 580 582 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); 583 585 } 584 586 … … 587 589 * @interface_method_impl{DBGFOSIWINNT,pfnQueryCurThrdForVCpu, Generic EMT wrapper.} 588 590 */ 589 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, VMCPUID idCpu,590 PRTGCUINTPTR pCurThrd)591 static DECLCALLBACK(int) dbgfR3OSEmtIWinNt_QueryCurThrdForVCpu(struct DBGFOSIWINNT *pThis, PUVM pUVM, PCVMMR3VTABLE pVMM, 592 VMCPUID idCpu, PRTGCUINTPTR pCurThrd) 591 593 { 592 594 PDBGFOSEMTWRAPPER pWrapper = RT_FROM_MEMBER(pThis, DBGFOSEMTWRAPPER, uWrapper.WinNt); … … 595 597 596 598 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); 599 601 } 600 602 … … 622 624 { 623 625 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); 625 627 if (pvDiggerIf) 626 628 { … … 730 732 PDBGFOS pOS = pUVM->dbgf.s.pCurOS; 731 733 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, 733 735 pState, pInitialCtx, hAs, puScratch); 734 736 DBGF_OS_READ_UNLOCK(pUVM); -
trunk/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp
r93115 r93470 23 23 #include <VBox/vmm/dbgf.h> 24 24 #include <VBox/vmm/mm.h> 25 #include <VBox/vmm/vmm.h> 25 26 #include "DBGFInternal.h" 26 27 #include <VBox/vmm/uvm.h> … … 367 368 * Try initialize it. 368 369 */ 369 rc = pPlugIn->pfnEntry(DBGFPLUGINOP_INIT, pUVM, V BOX_VERSION);370 rc = pPlugIn->pfnEntry(DBGFPLUGINOP_INIT, pUVM, VMMR3GetVTable(), VBOX_VERSION); 370 371 if (RT_SUCCESS(rc)) 371 372 { … … 538 539 pUVM->dbgf.s.pPlugInHead = pPlugIn->pNext; 539 540 540 pPlugIn->pfnEntry(DBGFPLUGINOP_TERM, pUVM, 0);541 pPlugIn->pfnEntry(DBGFPLUGINOP_TERM, pUVM, VMMR3GetVTable(), 0); 541 542 RTLdrClose(pPlugIn->hLdrMod); 542 543 … … 568 569 pUVM->dbgf.s.pPlugInHead = pPlugin->pNext; 569 570 570 pPlugin->pfnEntry(DBGFPLUGINOP_TERM, pUVM, 0);571 pPlugin->pfnEntry(DBGFPLUGINOP_TERM, pUVM, VMMR3GetVTable(), 0); 571 572 572 573 int rc2 = RTLdrClose(pPlugin->hLdrMod); -
trunk/src/VBox/VMM/VMMR3/SSM.cpp
r93444 r93470 150 150 #include <VBox/vmm/pdmcritsect.h> 151 151 #include <VBox/vmm/mm.h> 152 #include <VBox/vmm/vmm.h> 152 153 #include "SSMInternal.h" 153 154 #include <VBox/vmm/vm.h> 154 155 #include <VBox/vmm/uvm.h> 155 #include <VBox/vmm/vmmr3vtable.h>156 156 #include <VBox/err.h> 157 157 #include <VBox/log.h> -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r93444 r93470 68 68 #include "VMInternal.h" 69 69 #include <VBox/vmm/vmcc.h> 70 #include <VBox/vmm/vmmr3vtable.h>71 70 72 71 #include <VBox/sup.h>
Note:
See TracChangeset
for help on using the changeset viewer.