Changeset 46167 in vbox for trunk/src/VBox
- Timestamp:
- May 19, 2013 10:12:49 PM (12 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCCommands.cpp
r46127 r46167 61 61 static FNDBGCCMD dbgcCmdLoadMap; 62 62 static FNDBGCCMD dbgcCmdLoadSeg; 63 static FNDBGCCMD dbgcCmdLoadSyms;64 63 static FNDBGCCMD dbgcCmdSet; 65 64 static FNDBGCCMD dbgcCmdUnset; … … 155 154 { 1, 1, DBGCVAR_CAT_NUMBER, 0, "seg", "The module segment number (0-based)." }, 156 155 { 0, 1, DBGCVAR_CAT_STRING, DBGCVD_FLAGS_DEP_PREV, "name", "The module name. Empty string means default. (optional)" }, 157 };158 159 160 /** loadsyms arguments. */161 static const DBGCVARDESC g_aArgLoadSyms[] =162 {163 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */164 { 1, 1, DBGCVAR_CAT_STRING, 0, "path", "Filename string." },165 { 0, 1, DBGCVAR_CAT_NUMBER, 0, "delta", "Delta to add to the loaded symbols. (optional)" },166 { 0, 1, DBGCVAR_CAT_STRING, 0, "module name", "Module name. (optional)" },167 { 0, 1, DBGCVAR_CAT_POINTER, DBGCVD_FLAGS_DEP_PREV, "module address", "Module address. (optional)" },168 { 0, 1, DBGCVAR_CAT_NUMBER, 0, "module size", "The module size. (optional)" },169 156 }; 170 157 … … 250 237 "Loads the symbols of a segment in the executable image at the specified address. " 251 238 /*"Optionally giving the module a name other than the file name stem."*/ }, 252 { "loadsyms", 1, 5, &g_aArgLoadSyms[0], RT_ELEMENTS(g_aArgLoadSyms), 0, dbgcCmdLoadSyms, "<filename> [delta] [module] [module address]", "Loads symbols from a text file. Optionally giving a delta and a module." },253 239 { "loadvars", 1, 1, &g_aArgFilename[0], RT_ELEMENTS(g_aArgFilename), 0, dbgcCmdLoadVars, "<filename>", "Load variables from file. One per line, same as the args to the set command." }, 254 240 { "log", 1, 1, &g_aArgLog[0], RT_ELEMENTS(g_aArgLog), 0, dbgcCmdLog, "<group string>", "Modifies the logging group settings (VBOX_LOG)" }, … … 1388 1374 1389 1375 /** 1390 * @interface_method_impl{FNDBCCMD, The 'loadsyms' command.}1391 */1392 static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)1393 {1394 /*1395 * Validate the parsing and make sense of the input.1396 * This is a mess as usual because we don't trust the parser yet.1397 */1398 if ( cArgs < 11399 || paArgs[0].enmType != DBGCVAR_TYPE_STRING)1400 {1401 AssertMsgFailed(("Parse error, first argument required to be string!\n"));1402 return VERR_DBGC_PARSE_INCORRECT_ARG_TYPE;1403 }1404 DBGCVAR AddrVar;1405 RTGCUINTPTR Delta = 0;1406 const char *pszModule = NULL;1407 RTGCUINTPTR ModuleAddress = 0;1408 unsigned cbModule = 0;1409 if (cArgs > 1)1410 {1411 unsigned iArg = 1;1412 if (paArgs[iArg].enmType == DBGCVAR_TYPE_NUMBER)1413 {1414 Delta = (RTGCUINTPTR)paArgs[iArg].u.u64Number;1415 iArg++;1416 }1417 if (iArg < cArgs)1418 {1419 if (paArgs[iArg].enmType != DBGCVAR_TYPE_STRING)1420 {1421 AssertMsgFailed(("Parse error, module argument required to be string!\n"));1422 return VERR_DBGC_PARSE_INCORRECT_ARG_TYPE;1423 }1424 pszModule = paArgs[iArg].u.pszString;1425 iArg++;1426 if (iArg < cArgs)1427 {1428 if (!DBGCVAR_ISPOINTER(paArgs[iArg].enmType))1429 {1430 AssertMsgFailed(("Parse error, module argument required to be GC pointer!\n"));1431 return VERR_DBGC_PARSE_INCORRECT_ARG_TYPE;1432 }1433 int rc = DBGCCmdHlpEval(pCmdHlp, &AddrVar, "%%(%Dv)", &paArgs[iArg]);1434 if (RT_FAILURE(rc))1435 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Module address cast %%(%Dv) failed.", &paArgs[iArg]);1436 ModuleAddress = paArgs[iArg].u.GCFlat;1437 iArg++;1438 if (iArg < cArgs)1439 {1440 if (paArgs[iArg].enmType != DBGCVAR_TYPE_NUMBER)1441 {1442 AssertMsgFailed(("Parse error, module argument required to be an integer!\n"));1443 return VERR_DBGC_PARSE_INCORRECT_ARG_TYPE;1444 }1445 cbModule = (unsigned)paArgs[iArg].u.u64Number;1446 iArg++;1447 if (iArg < cArgs)1448 {1449 AssertMsgFailed(("Parse error, too many arguments!\n"));1450 return VERR_DBGC_PARSE_TOO_MANY_ARGUMENTS;1451 }1452 }1453 }1454 }1455 }1456 1457 /*1458 * Call the debug info manager about this loading...1459 */1460 int rc = DBGFR3ModuleLoad(pUVM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule);1461 if (RT_FAILURE(rc))1462 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n",1463 paArgs[0].u.pszString, Delta, pszModule, ModuleAddress);1464 1465 NOREF(pCmd);1466 return VINF_SUCCESS;1467 }1468 1469 1470 /**1471 1376 * @interface_method_impl{FNDBCCMD, The 'set' command.} 1472 1377 */ -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r46165 r46167 123 123 } 124 124 VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings) 125 {126 return VERR_INTERNAL_ERROR;127 }128 VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)129 125 { 130 126 return VERR_INTERNAL_ERROR; -
trunk/src/VBox/VMM/Makefile.kmk
r46165 r46167 126 126 VMMR3/DBGFReg.cpp \ 127 127 VMMR3/DBGFStack.cpp \ 128 VMMR3/DBGFSym.cpp \129 128 VMMR3/DBGFR3Trace.cpp \ 130 129 VMMR3/EM.cpp \ -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r46159 r46167 148 148 if (RT_SUCCESS(rc)) 149 149 rc = dbgfR3AsInit(pUVM); 150 if (RT_SUCCESS(rc))151 rc = dbgfR3SymInit(pVM);152 150 if (RT_SUCCESS(rc)) 153 151 rc = dbgfR3BpInit(pVM); -
trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
r46165 r46167 1137 1137 RTDbgModRelease(hMod); 1138 1138 } 1139 /* Temporary conversions. */1140 else if (hDbgAs == DBGF_AS_GLOBAL)1141 {1142 DBGFSYMBOL DbgfSym;1143 rc = DBGFR3SymbolByAddr(pUVM->pVM, pAddress->FlatPtr, poffDisp, &DbgfSym);1144 if (RT_SUCCESS(rc))1145 dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);1146 }1147 else if (hDbgAs == DBGF_AS_R0)1148 {1149 RTR0PTR R0PtrMod;1150 char szNearSym[260];1151 RTR0PTR R0PtrNearSym;1152 RTR0PTR R0PtrNearSym2;1153 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);1154 rc = PDMR3LdrQueryR0ModFromPC(pUVM->pVM, pAddress->FlatPtr,1155 pSymbol->szName, sizeof(pSymbol->szName) / 2, &R0PtrMod,1156 &szNearSym[0], sizeof(szNearSym), &R0PtrNearSym,1157 NULL, 0, &R0PtrNearSym2);1158 if (RT_SUCCESS(rc))1159 {1160 pSymbol->offSeg = pSymbol->Value = R0PtrNearSym;1161 pSymbol->cb = R0PtrNearSym2 > R0PtrNearSym ? R0PtrNearSym2 - R0PtrNearSym : 0;1162 pSymbol->iSeg = 0;1163 pSymbol->fFlags = 0;1164 pSymbol->iOrdinal = UINT32_MAX;1165 size_t offName = strlen(pSymbol->szName);1166 pSymbol->szName[offName++] = '!';1167 size_t cchNearSym = strlen(szNearSym);1168 if (cchNearSym + offName >= sizeof(pSymbol->szName))1169 cchNearSym = sizeof(pSymbol->szName) - offName - 1;1170 strncpy(&pSymbol->szName[offName], szNearSym, cchNearSym);1171 pSymbol->szName[offName + cchNearSym] = '\0';1172 if (poffDisp)1173 *poffDisp = pAddress->FlatPtr - pSymbol->Value;1174 }1175 }1176 1139 1177 1140 return rc; … … 1259 1222 if (!phMod) 1260 1223 RTDbgModRelease(hMod); 1261 }1262 /* Temporary conversion. */1263 else if (hDbgAs == DBGF_AS_GLOBAL)1264 {1265 DBGFSYMBOL DbgfSym;1266 rc = DBGFR3SymbolByName(pUVM->pVM, pszSymbol, &DbgfSym);1267 if (RT_SUCCESS(rc))1268 dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);1269 1224 } 1270 1225 -
trunk/src/VBox/VMM/VMMR3/PATMR3Dbg.cpp
r46159 r46167 191 191 if (off + 8 <= sizeof(szName)) 192 192 { 193 DBGFSYMBOL Symbol; 194 RTGCINTPTR offDisp; 195 196 int rc = DBGFR3SymbolByAddr(pVM, pPatchRec->patch.pPrivInstrGC, &offDisp, &Symbol); 193 RTDBGSYMBOL Symbol; 194 RTGCINTPTR offDisp; 195 DBGFADDRESS Addr; 196 197 int rc = DBGFR3AsSymbolByAddr(pVM->pUVM, DBGF_AS_GLOBAL, 198 DBGFR3AddrFromFlat(pVM->pUVM, &Addr, pPatchRec->patch.pPrivInstrGC), 199 RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL, 200 &offDisp, &Symbol, NULL /*phMod*/); 197 201 if (RT_SUCCESS(rc)) 198 202 { -
trunk/src/VBox/VMM/include/DBGFInternal.h
r45984 r46167 234 234 DBGFCMDDATA VMMCmdData; 235 235 236 /** Range tree containing the loaded symbols of the a VM.237 * This tree will never have blind spots. */238 R3PTRTYPE(AVLRGCPTRTREE) SymbolTree;239 /** Symbol name space. */240 R3PTRTYPE(PRTSTRSPACE) pSymbolSpace;241 /** Indicates whether DBGFSym.cpp is initialized or not.242 * This part is initialized in a lazy manner for performance reasons. */243 bool fSymInited;244 /** Alignment padding. */245 uint32_t uAlignment0;246 247 236 /** The number of hardware breakpoints. */ 248 237 uint32_t cHwBreakpoints; … … 358 347 int dbgfR3RegInit(PUVM pUVM); 359 348 void dbgfR3RegTerm(PUVM pUVM); 360 int dbgfR3SymInit(PVM pVM);361 int dbgfR3SymTerm(PVM pVM);362 349 int dbgfR3TraceInit(PVM pVM); 363 350 void dbgfR3TraceRelocate(PVM pVM); -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r45739 r46167 221 221 //GEN_CHECK_OFF(DBGF, pInfoFirst); 222 222 //GEN_CHECK_OFF(DBGF, InfoCritSect); 223 GEN_CHECK_OFF(DBGF, SymbolTree);224 GEN_CHECK_OFF(DBGF, pSymbolSpace);225 GEN_CHECK_OFF(DBGF, fSymInited);226 223 GEN_CHECK_OFF(DBGF, cHwBreakpoints); 227 224 GEN_CHECK_OFF(DBGF, cBreakpoints);
Note:
See TracChangeset
for help on using the changeset viewer.