Changeset 39650 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 16, 2011 11:27:51 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
r35550 r39650 150 150 return RTEXITCODE_SUCCESS; 151 151 } 152 153 /** 154 * Handles the log sub-command. 155 * 156 * @returns Suitable exit code. 157 * @param pArgs The handler arguments. 158 * @param pDebugger Pointer to the debugger interface. 159 * @param pszSubCmd The sub command. 160 */ 161 static RTEXITCODE handleDebugVM_LogXXXX(HandlerArg *pArgs, IMachineDebugger *pDebugger, const char *pszSubCmd) 162 { 163 /* 164 * Parse arguments. 165 */ 166 bool fRelease = false; 167 com::Utf8Str strSettings; 168 169 RTGETOPTSTATE GetState; 170 RTGETOPTUNION ValueUnion; 171 static const RTGETOPTDEF s_aOptions[] = 172 { 173 { "--release", 'r', RTGETOPT_REQ_NOTHING }, 174 }; 175 int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, 0 /*fFlags*/); 176 AssertRCReturn(rc, RTEXITCODE_FAILURE); 177 178 while ((rc = RTGetOpt(&GetState, &ValueUnion)) != 0) 179 { 180 switch (rc) 181 { 182 case 'r': 183 fRelease = true; 184 break; 185 186 case 'd': 187 fRelease = false; 188 break; 189 190 case VINF_GETOPT_NOT_OPTION: 191 if (strSettings.length() == 0) 192 strSettings = ValueUnion.psz; 193 else 194 { 195 strSettings.append(' '); 196 strSettings.append(ValueUnion.psz); 197 } 198 break; 199 200 default: 201 return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion); 202 } 203 } 204 205 if (fRelease) 206 { 207 com::Utf8Str strTmp(strSettings); 208 strSettings = "release: "; 209 strSettings.append(strTmp); 210 } 211 212 com::Bstr bstrSettings(strSettings); 213 if (!strcmp(pszSubCmd, "log")) 214 CHECK_ERROR2_RET(pDebugger, ModifyLogGroups(bstrSettings.raw()), RTEXITCODE_FAILURE); 215 else if (!strcmp(pszSubCmd, "logdest")) 216 CHECK_ERROR2_RET(pDebugger, ModifyLogDestinations(bstrSettings.raw()), RTEXITCODE_FAILURE); 217 else if (!strcmp(pszSubCmd, "logflags")) 218 CHECK_ERROR2_RET(pDebugger, ModifyLogFlags(bstrSettings.raw()), RTEXITCODE_FAILURE); 219 else 220 AssertFailedReturn(RTEXITCODE_FAILURE); 221 222 return RTEXITCODE_SUCCESS; 223 } 224 152 225 153 226 /** … … 442 515 else if (!strcmp(pszSubCmd, "injectnmi")) 443 516 rcExit = handleDebugVM_InjectNMI(pArgs, ptrDebugger); 517 else if (!strcmp(pszSubCmd, "log")) 518 rcExit = handleDebugVM_LogXXXX(pArgs, ptrDebugger, pszSubCmd); 519 else if (!strcmp(pszSubCmd, "logdest")) 520 rcExit = handleDebugVM_LogXXXX(pArgs, ptrDebugger, pszSubCmd); 521 else if (!strcmp(pszSubCmd, "logflags")) 522 rcExit = handleDebugVM_LogXXXX(pArgs, ptrDebugger, pszSubCmd); 444 523 else if (!strcmp(pszSubCmd, "osdetect")) 445 524 rcExit = handleDebugVM_OSDetect(pArgs, ptrDebugger); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r39169 r39650 645 645 " info <item> [args] |\n" 646 646 " injectnmi |\n" 647 " log [--release|--debug] <settings> ...|\n" 648 " logdest [--release|--debug] <settings> ...|\n" 649 " logflags [--release|--debug] <settings> ...|\n" 647 650 " osdetect |\n" 648 651 " osinfo |\n"
Note:
See TracChangeset
for help on using the changeset viewer.