Changeset 30078 in vbox
- Timestamp:
- Jun 7, 2010 2:41:10 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/DBGFAddrSpace.cpp
r29250 r30078 39 39 #define LOG_GROUP LOG_GROUP_DBGF 40 40 #include <VBox/dbgf.h> 41 #include <VBox/pdmapi.h> 41 42 #include <VBox/mm.h> 42 43 #include "DBGFInternal.h" … … 406 407 407 408 /** 409 * @callback_method_impl{FNPDMR3ENUM} 410 */ 411 static DECLCALLBACK(int) dbgfR3AsLazyPopulateR0Callback(PVM pVM, const char *pszFilename, const char *pszName, 412 RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg) 413 { 414 /* Only ring-0 modules. */ 415 if (!fRC) 416 { 417 RTDBGMOD hDbgMod; 418 int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszName, 0 /*fFlags*/); 419 if (RT_SUCCESS(rc)) 420 { 421 rc = RTDbgAsModuleLink((RTDBGAS)pvArg, hDbgMod, ImageBase, 0 /*fFlags*/); 422 if (RT_FAILURE(rc)) 423 LogRel(("DBGF: Failed to link module \"%s\" into DBGF_AS_R0 at %RTptr: %Rrc\n", 424 pszName, ImageBase, rc)); 425 } 426 else 427 LogRel(("DBGF: RTDbgModCreateFromImage failed with rc=%Rrc for module \"%s\" (%s)\n", 428 rc, pszName, pszFilename)); 429 } 430 return VINF_SUCCESS; 431 } 432 433 434 /** 435 * Lazily populates the specified address space. 436 * 437 * @param pVM The VM handle. 438 * @param hAlias The alias. 439 */ 440 static void dbgfR3AsLazyPopulate(PVM pVM, RTDBGAS hAlias) 441 { 442 DBGF_AS_DB_LOCK_WRITE(pVM); 443 uintptr_t iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias); 444 if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias]) 445 { 446 RTDBGAS hAs = pVM->dbgf.s.ahAsAliases[iAlias]; 447 if (hAlias == DBGF_AS_R0) 448 PDMR3LdrEnumModules(pVM, dbgfR3AsLazyPopulateR0Callback, hAs); 449 /** @todo what do we do about DBGF_AS_RC? */ 450 451 pVM->dbgf.s.afAsAliasPopuplated[iAlias] = true; 452 } 453 DBGF_AS_DB_UNLOCK_WRITE(pVM); 454 } 455 456 457 /** 408 458 * Resolves the address space handle into a real handle if it's an alias. 409 459 * … … 447 497 if (DBGF_AS_IS_FIXED_ALIAS(hAlias)) 448 498 { 499 /* Perform lazy address space population. */ 500 if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias]) 501 dbgfR3AsLazyPopulate(pVM, hAlias); 502 449 503 /* Won't ever change, no need to grab the lock. */ 450 504 hAlias = pVM->dbgf.s.ahAsAliases[iAlias]; … … 927 981 RTDbgModRelease(hMod); 928 982 } 929 /* Temporary conversion . */983 /* Temporary conversions. */ 930 984 else if (hDbgAs == DBGF_AS_GLOBAL) 931 985 { … … 934 988 if (RT_SUCCESS(rc)) 935 989 dbgfR3AsSymbolConvert(pSymbol, &DbgfSym); 990 } 991 else if (hDbgAs == DBGF_AS_R0) 992 { 993 RTR0PTR R0PtrMod; 994 char szNearSym[260]; 995 RTR0PTR R0PtrNearSym; 996 RTR0PTR R0PtrNearSym2; 997 rc = PDMR3LdrQueryR0ModFromPC(pVM, pAddress->FlatPtr, 998 pSymbol->szName, sizeof(pSymbol->szName) / 2, &R0PtrMod, 999 &szNearSym[0], sizeof(szNearSym), &R0PtrNearSym, 1000 NULL, 0, &R0PtrNearSym2); 1001 if (RT_SUCCESS(rc)) 1002 { 1003 pSymbol->offSeg = pSymbol->Value = R0PtrNearSym; 1004 pSymbol->cb = R0PtrNearSym2 > R0PtrNearSym ? R0PtrNearSym2 - R0PtrNearSym : 0; 1005 pSymbol->iSeg = 0; 1006 pSymbol->fFlags = 0; 1007 pSymbol->iOrdinal = UINT32_MAX; 1008 size_t offName = strlen(pSymbol->szName); 1009 pSymbol->szName[offName++] = '!'; 1010 size_t cchNearSym = strlen(szNearSym); 1011 if (cchNearSym + offName >= sizeof(pSymbol->szName)) 1012 cchNearSym = sizeof(pSymbol->szName) - offName - 1; 1013 strncpy(&pSymbol->szName[offName], szNearSym, cchNearSym); 1014 pSymbol->szName[offName + cchNearSym] = '\0'; 1015 if (poffDisp) 1016 *poffDisp = pAddress->FlatPtr - pSymbol->Value; 1017 } 936 1018 } 937 1019 -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r30072 r30078 1245 1245 VMMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock) 1246 1246 { 1247 #if !(defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)) // for provoking guru - DO NOT COMMIT THIS!1248 1247 int rc = pgmLock(pVM); 1249 1248 AssertRCReturn(rc, rc); 1250 #else1251 int rc;1252 #endif1253 1249 1254 1250 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) … … 1329 1325 1330 1326 #endif /* IN_RING3 || IN_RING0 */ 1331 #if !(defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)) // for provoking guru - DO NOT COMMIT THIS!1332 1327 pgmUnlock(pVM); 1333 #endif1334 1328 return rc; 1335 1329 }
Note:
See TracChangeset
for help on using the changeset viewer.