Changeset 55883 in vbox
- Timestamp:
- May 16, 2015 1:22:15 AM (9 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
idl/VirtualBox.xidl (modified) (2 diffs)
-
include/MachineDebuggerImpl.h (modified) (2 diffs)
-
src-client/MachineDebuggerImpl.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r55854 r55883 17164 17164 <interface 17165 17165 name="IMachineDebugger" extends="$unknown" 17166 uuid=" 5e4534dc-21b8-4f6b-8a08-eef50e1a0aa1"17166 uuid="b08d5aa9-4e35-3a17-2e4d-61948b590989" 17167 17167 wsmap="managed" 17168 17168 > … … 17345 17345 <param name="bytes" type="octet" safearray="yes" dir="in"> 17346 17346 <desc>The bytes to write.</desc> 17347 </param> 17348 </method> 17349 17350 <method name="loadPlugIn"> 17351 <desc> Loads a DBGF plug-in. </desc> 17352 <param name="name" type="wstring" dir="in"> 17353 <desc>The plug-in name or DLL. Special name 'all' loads all installed plug-ins.</desc> 17354 </param> 17355 <param name="plugInName" type="wstring" dir="return"> 17356 <desc>The name of the loaded plug-in.</desc> 17357 </param> 17358 </method> 17359 17360 <method name="unloadPlugIn"> 17361 <desc>Unloads a DBGF plug-in.</desc> 17362 <param name="name" type="wstring" dir="in"> 17363 <desc>The plug-in name or DLL. Special name 'all' unloads all plug-ins.</desc> 17347 17364 </param> 17348 17365 </method> -
trunk/src/VBox/Main/include/MachineDebuggerImpl.h
r51092 r55883 1 1 /* $Id$ */ 2 3 2 /** @file 4 *5 3 * VirtualBox COM class implementation 6 4 */ 7 5 8 6 /* 9 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 10 8 * 11 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 105 103 ULONG aSize, 106 104 const std::vector<BYTE> &aBytes); 105 HRESULT loadPlugIn(const com::Utf8Str &aName, 106 com::Utf8Str &aPlugInName); 107 HRESULT unloadPlugIn(const com::Utf8Str &aName); 107 108 HRESULT detectOS(com::Utf8Str &aOs); 108 109 HRESULT getRegister(ULONG aCpuId, -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r55702 r55883 1069 1069 } 1070 1070 1071 HRESULT MachineDebugger::detectOS(com::Utf8Str &aOs) 1072 { 1073 LogFlowThisFunc(("\n")); 1074 1071 HRESULT MachineDebugger::loadPlugIn(const com::Utf8Str &aName, com::Utf8Str &aPlugInName) 1072 { 1075 1073 /* 1076 * Do the autocaller and lock bits.1074 * Lock the debugger and get the VM pointer 1077 1075 */ 1078 1076 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1084 1082 * Do the job and try convert the name. 1085 1083 */ 1086 /** @todo automatically load the DBGC plugins or this is a waste of time. */ 1084 if (aName.equals("all")) 1085 { 1086 DBGFR3PlugInLoadAll(ptrVM.rawUVM()); 1087 try 1088 { 1089 aPlugInName = "all"; 1090 hrc = S_OK; 1091 } 1092 catch (std::bad_alloc) 1093 { 1094 hrc = E_OUTOFMEMORY; 1095 } 1096 } 1097 else 1098 { 1099 RTERRINFOSTATIC ErrInfo; 1100 char szName[80]; 1101 int vrc = DBGFR3PlugInLoad(ptrVM.rawUVM(), aName.c_str(), szName, sizeof(szName), RTErrInfoInitStatic(&ErrInfo)); 1102 if (RT_SUCCESS(vrc)) 1103 { 1104 try 1105 { 1106 aPlugInName = "all"; 1107 hrc = S_OK; 1108 } 1109 catch (std::bad_alloc) 1110 { 1111 hrc = E_OUTOFMEMORY; 1112 } 1113 } 1114 else 1115 hrc = setErrorVrc(vrc, "%s", ErrInfo.szMsg); 1116 } 1117 } 1118 return hrc; 1119 1120 } 1121 1122 HRESULT MachineDebugger::unloadPlugIn(const com::Utf8Str &aName) 1123 { 1124 /* 1125 * Lock the debugger and get the VM pointer 1126 */ 1127 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1128 Console::SafeVMPtr ptrVM(mParent); 1129 HRESULT hrc = ptrVM.rc(); 1130 if (SUCCEEDED(hrc)) 1131 { 1132 /* 1133 * Do the job and try convert the name. 1134 */ 1135 if (aName.equals("all")) 1136 { 1137 DBGFR3PlugInUnloadAll(ptrVM.rawUVM()); 1138 hrc = S_OK; 1139 } 1140 else 1141 { 1142 int vrc = DBGFR3PlugInUnload(ptrVM.rawUVM(), aName.c_str()); 1143 if (RT_SUCCESS(vrc)) 1144 hrc = S_OK; 1145 else if (vrc == VERR_NOT_FOUND) 1146 hrc = setErrorBoth(E_FAIL, vrc, "Plug-in '%s' was not found", aName.c_str()); 1147 else 1148 hrc = setErrorVrc(vrc, "Error unloading '%s': %Rrc", aName.c_str(), vrc); 1149 } 1150 } 1151 return hrc; 1152 1153 } 1154 1155 HRESULT MachineDebugger::detectOS(com::Utf8Str &aOs) 1156 { 1157 LogFlowThisFunc(("\n")); 1158 1159 /* 1160 * Lock the debugger and get the VM pointer 1161 */ 1162 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1163 Console::SafeVMPtr ptrVM(mParent); 1164 HRESULT hrc = ptrVM.rc(); 1165 if (SUCCEEDED(hrc)) 1166 { 1167 /* 1168 * Do the job. 1169 */ 1087 1170 char szName[64]; 1088 1171 int vrc = DBGFR3OSDetect(ptrVM.rawUVM(), szName, sizeof(szName)); … … 1091 1174 try 1092 1175 { 1093 Bstr bstrName(szName); 1094 aOs = Utf8Str(bstrName); 1176 aOs = szName; 1095 1177 } 1096 1178 catch (std::bad_alloc)
Note:
See TracChangeset
for help on using the changeset viewer.

