summaryrefslogtreecommitdiff
path: root/src/VBox/Debugger/VBoxDbg.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Debugger/VBoxDbg.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Debugger/VBoxDbg.cpp')
-rw-r--r--src/VBox/Debugger/VBoxDbg.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/VBox/Debugger/VBoxDbg.cpp b/src/VBox/Debugger/VBoxDbg.cpp
index 9c41c934..bc3287e9 100644
--- a/src/VBox/Debugger/VBoxDbg.cpp
+++ b/src/VBox/Debugger/VBoxDbg.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -71,11 +71,11 @@ static const DBGGUIVT g_dbgGuiVT =
*
* @returns VBox status code.
* @param pSession The ISession interface. (DBGGuiCreate)
- * @param pVM The VM handle. (DBGGuiCreateForVM)
+ * @param pUVM The VM handle. (DBGGuiCreateForVM)
* @param ppGui See DBGGuiCreate.
* @param ppGuiVT See DBGGuiCreate.
*/
-static int dbgGuiCreate(ISession *pSession, PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT)
+static int dbgGuiCreate(ISession *pSession, PUVM pUVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT)
{
/*
* Allocate and initialize the Debugger GUI handle.
@@ -90,7 +90,7 @@ static int dbgGuiCreate(ISession *pSession, PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT
if (pSession)
rc = pGui->pVBoxDbgGui->init(pSession);
else
- rc = pGui->pVBoxDbgGui->init(pVM);
+ rc = pGui->pVBoxDbgGui->init(pUVM);
if (RT_SUCCESS(rc))
{
/*
@@ -134,15 +134,20 @@ DBGDECL(int) DBGGuiCreate(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiV
* Creates the debugger GUI given a VM handle.
*
* @returns VBox status code.
- * @param pVM The VM handle.
+ * @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(PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT)
+DBGDECL(int) DBGGuiCreateForVM(PUVM pUVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT)
{
- AssertPtrReturn(pVM, VERR_INVALID_POINTER);
- return dbgGuiCreate(NULL, pVM, ppGui, 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;
}