Changeset 48696 in vbox for trunk/src/VBox
- Timestamp:
- Sep 26, 2013 12:22:48 AM (11 years ago)
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCCommands.cpp
r47281 r48696 62 62 static FNDBGCCMD dbgcCmdLoadMap; 63 63 static FNDBGCCMD dbgcCmdLoadSeg; 64 static FNDBGCCMD dbgcCmdUnload; 64 65 static FNDBGCCMD dbgcCmdSet; 65 66 static FNDBGCCMD dbgcCmdUnset; … … 196 197 { 1, 1, DBGCVAR_CAT_SYMBOL, 0, "var", "Variable name." }, 197 198 { 1, 1, DBGCVAR_CAT_ANY, 0, "value", "Value to assign to the variable." }, 199 }; 200 201 /** loadplugin, unloadplugin. */ 202 static const DBGCVARDESC g_aArgUnload[] = 203 { 204 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 205 { 1, ~0U, DBGCVAR_CAT_STRING, 0, "modname", "Unloads all mappings of the given modules in the active address space." }, 198 206 }; 199 207 … … 230 238 "Loads the symbols of an executable image at the specified address. " 231 239 /*"Optionally giving the module a name other than the file name stem."*/ }, /** @todo implement line breaks */ 240 { "loadimage32",2, 3, &g_aArgLoadImage[0], RT_ELEMENTS(g_aArgLoadImage), 0, dbgcCmdLoadImage, "<filename> <address> [name]", "loadimage variant for selecting 32-bit images (mach-o)." }, 241 { "loadimage64",2, 3, &g_aArgLoadImage[0], RT_ELEMENTS(g_aArgLoadImage), 0, dbgcCmdLoadImage, "<filename> <address> [name]", "loadimage variant for selecting 64-bit images (mach-o)." }, 232 242 { "loadmap", 2, 5, &g_aArgLoadMap[0], RT_ELEMENTS(g_aArgLoadMap), 0, dbgcCmdLoadMap, "<filename> <address> [name] [subtrahend] [seg]", 233 243 "Loads the symbols from a map file, usually at a specified address. " … … 250 260 { "showvars", 0, 0, NULL, 0, 0, dbgcCmdShowVars, "", "List all the defined variables." }, 251 261 { "stop", 0, 0, NULL, 0, 0, dbgcCmdStop, "", "Stop execution." }, 262 { "unload", 1, ~0U, &g_aArgUnload[0], RT_ELEMENTS(g_aArgUnload), 0, dbgcCmdUnload, "<modname1> [modname2..N]", "Unloads one or more modules in the current address space." }, 252 263 { "unloadplugin", 1, ~0U, &g_aArgPlugIn[0], RT_ELEMENTS(g_aArgPlugIn), 0, dbgcCmdUnloadPlugIn, "<plugin1> [plugin2..N]", "Unloads one or more plugins." }, 253 264 { "unset", 1, ~0U, &g_aArgUnset[0], RT_ELEMENTS(g_aArgUnset), 0, dbgcCmdUnset, "<var1> [var1..[varN]]", "Unsets (delete) one or more global variables." }, … … 1305 1316 1306 1317 /* 1318 * Determine the desired image arch from the load command used. 1319 */ 1320 RTLDRARCH enmArch = RTLDRARCH_WHATEVER; 1321 if (pCmd->pszCmd[sizeof("loadimage") - 1] == '3') 1322 enmArch = RTLDRARCH_X86_32; 1323 else if (pCmd->pszCmd[sizeof("loadimage") - 1] == '6') 1324 enmArch = RTLDRARCH_AMD64; 1325 1326 /* 1307 1327 * Try create a module for it. 1308 1328 */ 1309 1329 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1310 rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);1330 rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, enmArch, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/); 1311 1331 if (RT_FAILURE(rc)) 1312 1332 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n", 1313 1333 pszFilename, pszModName, &paArgs[1]); 1314 1334 1315 NOREF(pCmd);1316 1335 return VINF_SUCCESS; 1317 1336 } … … 1417 1436 */ 1418 1437 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1419 rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);1438 rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, RTLDRARCH_WHATEVER, &ModAddress, iModSeg, 0 /*fFlags*/); 1420 1439 if (RT_FAILURE(rc)) 1421 1440 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n", 1422 1441 pszFilename, pszModName, &paArgs[1]); 1442 1443 NOREF(pCmd); 1444 return VINF_SUCCESS; 1445 } 1446 1447 1448 /** 1449 * @interface_method_impl{FNDBCCMD, The 'unload' command.} 1450 */ 1451 static DECLCALLBACK(int) dbgcCmdUnload(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1452 { 1453 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1454 1455 /* 1456 * Validate the parsing and make sense of the input. 1457 * This is a mess as usual because we don't trust the parser yet. 1458 */ 1459 AssertReturn( cArgs >= 1 1460 && paArgs[0].enmType == DBGCVAR_TYPE_STRING, 1461 VERR_DBGC_PARSE_INCORRECT_ARG_TYPE); 1462 for (unsigned i = 0; i < cArgs; i++) 1463 { 1464 AssertReturn(paArgs[i].enmType == DBGCVAR_TYPE_STRING, VERR_DBGC_PARSE_INCORRECT_ARG_TYPE); 1465 1466 int rc = DBGFR3AsUnlinkModuleByName(pUVM, pDbgc->hDbgAs, paArgs[i].u.pszString); 1467 if (RT_FAILURE(rc)) 1468 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3AsUnlinkModuleByName(,,'%s')\n", paArgs[i].u.pszString); 1469 } 1423 1470 1424 1471 NOREF(pCmd); … … 1446 1493 if (!RT_C_IS_ALPHA(*pszVar) || *pszVar == '_') 1447 1494 return DBGCCmdHlpPrintf(pCmdHlp, 1448 "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*'!", paArgs[0].u.pszString); 1495 "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*'!", 1496 paArgs[0].u.pszString); 1449 1497 1450 1498 while (RT_C_IS_ALNUM(*pszVar) || *pszVar == '_') … … 1452 1500 if (*pszVar) 1453 1501 return DBGCCmdHlpPrintf(pCmdHlp, 1454 "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*]'!", paArgs[0].u.pszString); 1502 "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*]'!", 1503 paArgs[0].u.pszString); 1455 1504 1456 1505 -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r47569 r48696 130 130 return NIL_RTDBGCFG; 131 131 } 132 VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags) 132 VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, RTLDRARCH enmArch, 133 PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags) 133 134 { 134 135 return VERR_INTERNAL_ERROR; 135 136 } 136 137 VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags) 138 { 139 return VERR_INTERNAL_ERROR; 140 } 141 VMMR3DECL(int) DBGFR3AsUnlinkModuleByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszModName) 137 142 { 138 143 return VERR_INTERNAL_ERROR;
Note:
See TracChangeset
for help on using the changeset viewer.