Changeset 12462 in vbox for trunk/src/VBox/Debugger/VBoxDbg.cpp
- Timestamp:
- Sep 15, 2008 1:22:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/VBoxDbg.cpp
r12424 r12462 68 68 69 69 70 71 /** 72 * Creates the debugger GUI. 73 * 74 * @returns VBox status code. 75 * @param pSession The Virtual Box session. 76 * @param ppGui Where to store the pointer to the debugger instance. 77 * @param ppGuiVT Where to store the virtual method table pointer. 78 * Optional. 79 */ 80 DBGDECL(int) DBGGuiCreate(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT) 81 { 70 /** 71 * Internal worker for DBGGuiCreate and DBGGuiCreateForVM. 72 * 73 * @returns VBox status code. 74 * @param pSession The ISession interface. (DBGGuiCreate) 75 * @param pVM The VM handle. (DBGGuiCreateForVM) 76 * @param ppGui See DBGGuiCreate. 77 * @param ppGuiVT See DBGGuiCreate. 78 */ 79 static int dbgGuiCreate(ISession *pSession, PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT) 80 { 81 /* 82 * Allocate and initialize the Debugger GUI handle. 83 */ 82 84 PDBGGUI pGui = (PDBGGUI)RTMemAlloc(sizeof(*pGui)); 83 85 if (!pGui) … … 86 88 pGui->pVBoxDbgGui = new VBoxDbgGui(); 87 89 88 int rc = pGui->pVBoxDbgGui->init(pSession); 90 int rc; 91 if (pSession) 92 rc = pGui->pVBoxDbgGui->init(pSession); 93 else 94 rc = pGui->pVBoxDbgGui->init(pVM); 89 95 if (VBOX_SUCCESS(rc)) 90 96 { 97 /* 98 * Successfully initialized. 99 */ 91 100 *ppGui = pGui; 92 101 if (ppGuiVT) … … 95 104 } 96 105 106 /* 107 * Failed, cleanup. 108 */ 97 109 delete pGui->pVBoxDbgGui; 98 110 RTMemFree(pGui); … … 105 117 106 118 /** 119 * Creates the debugger GUI. 120 * 121 * @returns VBox status code. 122 * @param pSession The Virtual Box session. 123 * @param ppGui Where to store the pointer to the debugger instance. 124 * @param ppGuiVT Where to store the virtual method table pointer. 125 * Optional. 126 */ 127 DBGDECL(int) DBGGuiCreate(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT) 128 { 129 AssertPtrReturn(pSession, VERR_INVALID_POINTER); 130 return dbgGuiCreate(pSession, NULL, ppGui, ppGuiVT); 131 } 132 133 134 /** 135 * Creates the debugger GUI given a VM handle. 136 * 137 * @returns VBox status code. 138 * @param pVM The VM handle. 139 * @param ppGui Where to store the pointer to the debugger instance. 140 * @param ppGuiVT Where to store the virtual method table pointer. 141 * Optional. 142 */ 143 DBGDECL(int) DBGGuiCreateForVM(PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT) 144 { 145 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 146 return dbgGuiCreate(NULL, pVM, ppGui, ppGuiVT); 147 } 148 149 150 /** 107 151 * Destroys the debugger GUI. 108 152 *
Note:
See TracChangeset
for help on using the changeset viewer.