/** * Creates the debugger GUI given a VM handle. * * @returns VBox status code. * @param pUVM The VM handle. * @param ppGui Where to store the pointer to the debugger instance. * @param ppGuiVT Where to store the virtual method table pointer. * Optional. */ DBGDECL(int) DBGGuiCreateForVM(PUVM pUVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT) { AssertPtrReturn(pUVM, VERR_INVALID_POINTER); AssertPtrReturn(VMR3RetainUVM(pUVM) != UINT32_MAX, VERR_INVALID_POINTER); int rc = dbgGuiCreate(NULL, pUVM, ppGui, ppGuiVT); VMR3ReleaseUVM(pUVM); return rc; }
TeleporterState(Console *pConsole, PUVM pUVM, Progress *pProgress, bool fIsSource) : mptrConsole(pConsole) , mpUVM(pUVM) , mptrProgress(pProgress) , mfIsSource(fIsSource) , mhSocket(NIL_RTSOCKET) , moffStream(UINT64_MAX / 2) , mcbReadBlock(0) , mfStopReading(false) , mfEndOfStream(false) , mfIOError(false) { VMR3RetainUVM(mpUVM); }
VBoxDbgBase::VBoxDbgBase(VBoxDbgGui *a_pDbgGui) : m_pDbgGui(a_pDbgGui), m_pUVM(NULL), m_hGUIThread(RTThreadNativeSelf()) { /* * Register */ m_pUVM = a_pDbgGui->getUvmHandle(); if (m_pUVM) { VMR3RetainUVM(m_pUVM); int rc = VMR3AtStateRegister(m_pUVM, atStateChange, this); AssertRC(rc); } }
/** * Hack for getting the user mode VM handle (UVM). * * This is only temporary (promise) while prototyping the debugger. * * @returns COM status code * @param aVM Where to store the vm handle. Since there is no * uintptr_t in COM, we're using the max integer. * (No, ULONG is not pointer sized!) * @remarks The returned handle must be passed to VMR3ReleaseUVM()! * @remarks Prior to 4.3 this returned PVM. */ HRESULT MachineDebugger::getVM(LONG64 *aVM) { AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); Console::SafeVMPtr ptrVM(mParent); HRESULT hrc = ptrVM.rc(); if (SUCCEEDED(hrc)) { VMR3RetainUVM(ptrVM.rawUVM()); *aVM = (intptr_t)ptrVM.rawUVM(); } /* * Note! ptrVM protection provided by SafeVMPtr is no long effective * after we return from this method. */ return hrc; }