Changeset 46266 in vbox for trunk/src/VBox/Runtime/common/dbg
- Timestamp:
- May 25, 2013 7:51:19 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86000
- Location:
- trunk/src/VBox/Runtime/common/dbg
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r46199 r46266 280 280 if (RT_SUCCESS(rc)) 281 281 rc = rtDbgModDebugInterpreterRegister(&g_rtDbgModVtDbgDwarf); 282 #if 0 /* NOTE!! EXPERIMENTAL, SHOULDN'T BE ENABLED IN SVN YET!! */ 283 if (RT_SUCCESS(rc)) 284 rc = rtDbgModDebugInterpreterRegister(&g_rtDbgModVtDbgCodeView); 285 #endif 282 286 #ifdef RT_OS_WINDOWS 283 287 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp
r46164 r46266 366 366 367 367 Log(("Segment %.*s: LinkAddress=%#llx RVA=%#llx cb=%#llx\n", 368 pSeg->cchName, pSeg->pchName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb)); 368 pSeg->cchName, pSeg->pszName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb)); 369 370 Assert(pSeg->cchName > 0); 371 Assert(!pSeg->pszName[pSeg->cchName]); 369 372 370 373 if (!pSeg->RVA) 371 374 pArgs->uModAddr = pSeg->LinkAddress; 372 375 373 NOREF(hLdrMod);374 char *pszName = (char *)pSeg->pchName;375 if (pszName[pSeg->cchName])376 {377 pszName = (char *)alloca(pSeg->cchName + 1);378 memcpy(pszName, pSeg->pchName, pSeg->cchName);379 pszName[pSeg->cchName] = '\0';380 }381 382 376 RTLDRADDR cb = RT_MAX(pSeg->cb, pSeg->cbMapped); 383 return RTDbgModSegmentAdd(pArgs->hCnt, pSeg->RVA, cb, p szName, 0 /*fFlags*/, NULL);377 return RTDbgModSegmentAdd(pArgs->hCnt, pSeg->RVA, cb, pSeg->pszName, 0 /*fFlags*/, NULL); 384 378 } 385 379 -
trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
r46164 r46266 467 467 468 468 469 /** @interface_method_impl{RTDBGMODVTIMG,pfnReadAt} */ 470 static DECLCALLBACK(int) rtDbgModDeferredImg_ReadAt(PRTDBGMODINT pMod, uint32_t iDbgInfoHint, RTFOFF off, void *pvBuf, size_t cb) 471 { 472 int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/); 473 if (RT_SUCCESS(rc)) 474 rc = pMod->pImgVt->pfnReadAt(pMod, iDbgInfoHint, off, pvBuf, cb); 475 return rc; 476 } 477 478 469 479 /** @interface_method_impl{RTDBGMODVTIMG,pfnUnmapPart} */ 470 480 static DECLCALLBACK(int) rtDbgModDeferredImg_UnmapPart(PRTDBGMODINT pMod, size_t cb, void const **ppvMap) … … 580 590 /*.pfnMapPart = */ rtDbgModDeferredImg_MapPart, 581 591 /*.pfnUnmapPart = */ rtDbgModDeferredImg_UnmapPart, 592 /*.pfnReadAt = */ rtDbgModDeferredImg_ReadAt, 582 593 /*.pfnGetFormat = */ rtDbgModDeferredImg_GetFormat, 583 594 /*.pfnGetArch = */ rtDbgModDeferredImg_GetArch, -
trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp
r46261 r46266 1177 1177 PRTDBGMODDWARF pThis = (PRTDBGMODDWARF)pvUser; 1178 1178 Log(("Segment %.*s: LinkAddress=%#llx RVA=%#llx cb=%#llx\n", 1179 pSeg->cchName, pSeg->p chName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb));1179 pSeg->cchName, pSeg->pszName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb)); 1180 1180 NOREF(hLdrMod); 1181 1181 … … 1193 1193 PRTDBGMODDWARF pThis = (PRTDBGMODDWARF)pvUser; 1194 1194 Log(("Segment %.*s: LinkAddress=%#llx RVA=%#llx cb=%#llx\n", 1195 pSeg->cchName, pSeg->p chName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb));1195 pSeg->cchName, pSeg->pszName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb)); 1196 1196 NOREF(hLdrMod); 1197 AssertReturn(!pSeg->pchName[pSeg->cchName], VERR_DWARF_IPE); 1197 Assert(pSeg->cchName > 0); 1198 Assert(!pSeg->pszName[pSeg->cchName]); 1198 1199 1199 1200 /* If the segment doesn't have a mapping, just add a dummy so the indexing 1200 1201 works out correctly (same as for the image). */ 1201 1202 if (pSeg->RVA == NIL_RTLDRADDR) 1202 return RTDbgModSegmentAdd(pThis->hCnt, 0, 0, pSeg->p chName, 0 /*fFlags*/, NULL);1203 return RTDbgModSegmentAdd(pThis->hCnt, 0, 0, pSeg->pszName, 0 /*fFlags*/, NULL); 1203 1204 1204 1205 /* The link address is 0 for all segments in a relocatable ELF image. */ 1205 1206 RTLDRADDR cb = RT_MAX(pSeg->cb, pSeg->cbMapped); 1206 return RTDbgModSegmentAdd(pThis->hCnt, pSeg->RVA, cb, pSeg->p chName, 0 /*fFlags*/, NULL);1207 return RTDbgModSegmentAdd(pThis->hCnt, pSeg->RVA, cb, pSeg->pszName, 0 /*fFlags*/, NULL); 1207 1208 } 1208 1209 -
trunk/src/VBox/Runtime/common/dbg/dbgmodexports.cpp
r46199 r46266 79 79 PRTDBGMODEXPORTARGS pArgs = (PRTDBGMODEXPORTARGS)pvUser; 80 80 Log(("Segment %.*s: LinkAddress=%#llx RVA=%#llx cb=%#llx\n", 81 pSeg->cchName, pSeg->p chName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb));81 pSeg->cchName, pSeg->pszName, (uint64_t)pSeg->LinkAddress, (uint64_t)pSeg->RVA, pSeg->cb)); 82 82 NOREF(hLdrMod); 83 83 … … 88 88 pArgs->uImageBase = pSeg->LinkAddress; 89 89 90 /* Make sure the name is terminated before we add it. */91 char *pszName = (char *)pSeg->pchName;92 if (pszName[pSeg->cchName])93 {94 pszName = (char *)alloca(pSeg->cchName + 1);95 memcpy(pszName, pSeg->pchName, pSeg->cchName);96 pszName[pSeg->cchName] = '\0';97 }98 99 90 /* Add dummy segments for segments that doesn't get mapped. */ 100 91 if (pSeg->LinkAddress == NIL_RTLDRADDR) 101 return RTDbgModSegmentAdd(pArgs->pDbgMod, 0, 0, p szName, 0 /*fFlags*/, NULL);92 return RTDbgModSegmentAdd(pArgs->pDbgMod, 0, 0, pSeg->pszName, 0 /*fFlags*/, NULL); 102 93 103 94 RTLDRADDR cb = RT_MAX(pSeg->cb, pSeg->cbMapped); 104 return RTDbgModSegmentAdd(pArgs->pDbgMod, pSeg->RVA, cb, p szName, 0 /*fFlags*/, NULL);95 return RTDbgModSegmentAdd(pArgs->pDbgMod, pSeg->RVA, cb, pSeg->pszName, 0 /*fFlags*/, NULL); 105 96 } 106 97 -
trunk/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
r46164 r46266 74 74 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; 75 75 return RTLdrGetFormat(pThis->hLdrMod); 76 } 77 78 79 /** @interface_method_impl{RTDBGMODVTIMG,pfnReadAt} */ 80 static DECLCALLBACK(int) rtDbgModLdr_ReadAt(PRTDBGMODINT pMod, uint32_t iDbgInfoHint, RTFOFF off, void *pvBuf, size_t cb) 81 { 82 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; 83 return rtLdrReadAt(pThis->hLdrMod, pvBuf, UINT32_MAX /** @todo iDbgInfo*/, off, cb); 76 84 } 77 85 … … 205 213 /*.pfnMapPart = */ rtDbgModLdr_MapPart, 206 214 /*.pfnUnmapPart = */ rtDbgModLdr_UnmapPart, 215 /*.pfnReadAt = */ rtDbgModLdr_ReadAt, 207 216 /*.pfnGetFormat = */ rtDbgModLdr_GetFormat, 208 217 /*.pfnGetArch = */ rtDbgModLdr_GetArch,
Note:
See TracChangeset
for help on using the changeset viewer.