Changeset 46149 in vbox for trunk/src/VBox/Runtime/common/dbg
- Timestamp:
- May 17, 2013 5:21:23 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85849
- Location:
- trunk/src/VBox/Runtime/common/dbg
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
r46134 r46149 488 488 if ( uRva <= uCurRvaLast 489 489 && uRvaLast >= uCurRva 490 && (cb != 0 || pThis->paSegs[iSeg].cb != 0)) /* HACK ALERT! Allow empty segments to share space (bios/watcom). */ 490 && ( /* HACK ALERT! Allow empty segments to share space (bios/watcom, elf). */ 491 (cb != 0 && pThis->paSegs[iSeg].cb != 0) 492 || ( cb == 0 493 && uRva != uCurRva 494 && uRva != uCurRvaLast) 495 || ( pThis->paSegs[iSeg].cb == 0 496 && uCurRva != uRva 497 && uCurRva != uRvaLast) 498 ) 499 ) 491 500 AssertMsgFailedReturn(("uRva=%RTptr uRvaLast=%RTptr (cb=%RTptr) \"%s\";\n" 492 501 "uRva=%RTptr uRvaLast=%RTptr (cb=%RTptr) \"%s\" iSeg=%#x\n", … … 600 609 else 601 610 { 602 /* between iSeg and iLast. */611 /* between iSeg and iLast. paSeg[iSeg].cb == 0 ends up here too. */ 603 612 if (iSeg == iLast) 604 613 break; -
trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
r46115 r46149 451 451 452 452 /** @interface_method_impl{RTDBGMODVTIMG,pfnMapPart} */ 453 static DECLCALLBACK(int) rtDbgModDeferredImg_MapPart(PRTDBGMODINT pMod, RTFOFF off, size_t cb, void const **ppvMap)454 { 455 int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/); 456 if (RT_SUCCESS(rc)) 457 rc = pMod->pImgVt->pfnMapPart(pMod, off, cb, ppvMap);453 static DECLCALLBACK(int) rtDbgModDeferredImg_MapPart(PRTDBGMODINT pMod, uint32_t iDbgInfo, RTFOFF off, size_t cb, void const **ppvMap) 454 { 455 int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/); 456 if (RT_SUCCESS(rc)) 457 rc = pMod->pImgVt->pfnMapPart(pMod, iDbgInfo, off, cb, ppvMap); 458 458 return rc; 459 459 } … … 465 465 PRTDBGMODDEFERRED pThis = (PRTDBGMODDEFERRED)pMod->pvImgPriv; 466 466 return pThis->cbImage; 467 } 468 469 470 /** @interface_method_impl{RTDBGMODVTIMG,pfnRvaToSegOffset} */ 471 static DECLCALLBACK(int) rtDbgModDeferredImg_RvaToSegOffset(PRTDBGMODINT pMod, RTLDRADDR uRva, 472 PRTDBGSEGIDX piSeg, PRTLDRADDR poffSeg) 473 { 474 int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/); 475 if (RT_SUCCESS(rc)) 476 rc = pMod->pImgVt->pfnRvaToSegOffset(pMod, uRva, piSeg, poffSeg); 477 return rc; 467 478 } 468 479 … … 538 549 /*.pfnGetLoadedSize = */ rtDbgModDeferredImg_ImageSize, 539 550 /*.pfnLinkAddressToSegOffset = */ rtDbgModDeferredImg_LinkAddressToSegOffset, 551 /*.pfnRvaToSegOffset = */ rtDbgModDeferredImg_RvaToSegOffset, 540 552 /*.pfnMapPart = */ rtDbgModDeferredImg_MapPart, 541 553 /*.pfnUnmapPart = */ rtDbgModDeferredImg_UnmapPart, -
trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp
r45994 r46149 434 434 /** Set if present. */ 435 435 bool fPresent; 436 /** The debug info ordinal number in the image file. */ 437 uint32_t iDbgInfo; 436 438 } aSections[krtDbgModDwarfSect_End]; 437 439 … … 750 752 RTDWARFADDRRANGE PcRange; 751 753 /** The language name. */ 752 uint 8_tuLanguage;754 uint16_t uLanguage; 753 755 /** The identifier case. */ 754 756 uint8_t uIdentifierCase; … … 1179 1181 return RTDbgModSegmentAdd(pThis->hCnt, 0, 0, pSeg->pchName, 0 /*fFlags*/, NULL); 1180 1182 1183 /* The link address is 0 for all segments in a relocatable ELF image. */ 1181 1184 RTLDRADDR cb = RT_MAX(pSeg->cb, pSeg->cbMapped); 1182 #if 11183 1185 return RTDbgModSegmentAdd(pThis->hCnt, pSeg->RVA, cb, pSeg->pchName, 0 /*fFlags*/, NULL); 1184 #else1185 return RTDbgModSegmentAdd(pThis->hCnt, pSeg->LinkAddress, cb, pSeg->pchName, 0 /*fFlags*/, NULL);1186 #endif1187 1186 } 1188 1187 … … 1383 1382 * Do the job. 1384 1383 */ 1385 return pThis->pMod->pImgVt->pfnMapPart(pThis->pMod, pThis->aSections[enmSect].offFile, pThis->aSections[enmSect].cb, 1384 return pThis->pMod->pImgVt->pfnMapPart(pThis->pMod, 1385 pThis->aSections[enmSect].iDbgInfo, 1386 pThis->aSections[enmSect].offFile, 1387 pThis->aSections[enmSect].cb, 1386 1388 &pThis->aSections[enmSect].pv); 1387 1389 } … … 1449 1451 } 1450 1452 1451 return pThis->pMod->pImgVt->pfnLinkAddressToSegOffset(pThis->pMod, LinkAddress, piSeg, poffSeg); 1453 return pThis->pMod->pImgVt->pfnRvaToSegOffset(pThis->pMod, LinkAddress, piSeg, poffSeg); 1454 //return pThis->pMod->pImgVt->pfnLinkAddressToSegOffset(pThis->pMod, LinkAddress, piSeg, poffSeg); 1452 1455 } 1453 1456 … … 2011 2014 if (offRet != off) 2012 2015 { 2016 AssertFailed(); 2013 2017 pCursor->rc = VERR_OUT_OF_RANGE; 2014 2018 offRet = UINT32_MAX; … … 2311 2315 RTUINTPTR offSeg; 2312 2316 rc = rtDbgModDwarfLinkAddressToSegOffset(pLnState->pDwarfMod, pLnState->Regs.uSegment, pLnState->Regs.uAddress, 2313 &iSeg, &offSeg); 2317 &iSeg, &offSeg); AssertRC(rc); 2314 2318 if (RT_SUCCESS(rc)) 2315 2319 { … … 3134 3138 { 3135 3139 AssertReturn(ATTR_GET_SIZE(pDesc) == sizeof(RTDWARFADDRRANGE), VERR_INTERNAL_ERROR_3); 3136 AssertReturn(pDesc->uAttr == DW_AT_ low_pc || pDesc->uAttr == DW_AT_high_pc, VERR_INTERNAL_ERROR_3);3140 AssertReturn(pDesc->uAttr == DW_AT_ranges, VERR_INTERNAL_ERROR_3); 3137 3141 NOREF(pDie); 3138 3142 … … 3280 3284 /* Watcom generates offset past the end of the section, increasing the 3281 3285 offset by one for each compile unit. So, just fudge it. */ 3282 Log(("rtDwarfDecode_SectOff: bad off=%#llx, attr %#x (%s), enmSect=%d cb=%#llx; Assuming watcom .\n", off,3286 Log(("rtDwarfDecode_SectOff: bad off=%#llx, attr %#x (%s), enmSect=%d cb=%#llx; Assuming watcom/gcc.\n", off, 3283 3287 pDesc->uAttr, rtDwarfLog_AttrName(pDesc->uAttr), enmSect, cbSect)); 3284 3288 off = cbSect; … … 3346 3350 *pbMember = (uint8_t)u64Val; 3347 3351 if (*pbMember != u64Val) 3352 { 3353 AssertFailed(); 3348 3354 return VERR_OUT_OF_RANGE; 3355 } 3349 3356 break; 3350 3357 … … 3352 3359 *(uint16_t *)pbMember = (uint16_t)u64Val; 3353 3360 if (*(uint16_t *)pbMember != u64Val) 3361 { 3362 AssertFailed(); 3354 3363 return VERR_OUT_OF_RANGE; 3364 } 3355 3365 break; 3356 3366 … … 3358 3368 *(uint32_t *)pbMember = (uint32_t)u64Val; 3359 3369 if (*(uint32_t *)pbMember != u64Val) 3370 { 3371 AssertFailed(); 3360 3372 return VERR_OUT_OF_RANGE; 3373 } 3361 3374 break; 3362 3375 … … 3364 3377 *(uint64_t *)pbMember = (uint64_t)u64Val; 3365 3378 if (*(uint64_t *)pbMember != u64Val) 3379 { 3380 AssertFailed(); 3366 3381 return VERR_OUT_OF_RANGE; 3382 } 3367 3383 break; 3368 3384 … … 3670 3686 pSubProgram->PcRange.uLowAddress, 3671 3687 &iSeg, &offSeg); 3688 AssertRC(rc); 3672 3689 if (RT_SUCCESS(rc)) 3690 { 3673 3691 rc = RTDbgModSymbolAdd(pThis->hCnt, pSubProgram->pszName, iSeg, offSeg, 3674 3692 pSubProgram->PcRange.uHighAddress - pSubProgram->PcRange.uLowAddress, 3675 3693 0 /*fFlags*/, NULL /*piOrdinal*/); 3694 AssertRC(rc); 3695 } 3676 3696 else 3677 3697 Log5(("rtDbgModDwarfLinkAddressToSegOffset failed: %Rrc\n", rc)); … … 3699 3719 rc = rtDbgModDwarfLinkAddressToSegOffset(pThis, pLabel->uSegment, pLabel->Address.uAddress, 3700 3720 &iSeg, &offSeg); 3721 AssertRC(rc); 3701 3722 if (RT_SUCCESS(rc)) 3723 { 3702 3724 rc = RTDbgModSymbolAdd(pThis->hCnt, pLabel->pszName, iSeg, offSeg, 0 /*cb*/, 3703 3725 0 /*fFlags*/, NULL /*piOrdinal*/); 3726 AssertRC(rc); 3727 } 3704 3728 else 3705 3729 Log5(("rtDbgModDwarfLinkAddressToSegOffset failed: %Rrc\n", rc)); … … 4369 4393 pThis->aSections[enmSect].pv = NULL; 4370 4394 pThis->aSections[enmSect].cb = (size_t)pDbgInfo->cb; 4395 pThis->aSections[enmSect].iDbgInfo = pDbgInfo->iDbgInfo; 4371 4396 if (pThis->aSections[enmSect].cb != pDbgInfo->cb) 4372 4397 pThis->aSections[enmSect].cb = ~(size_t)0; -
trunk/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
r46113 r46149 71 71 72 72 /** @interface_method_impl{RTDBGMODVTIMG,pfnMapPart} */ 73 static DECLCALLBACK(int) rtDbgModLdr_MapPart(PRTDBGMODINT pMod, RTFOFF off, size_t cb, void const **ppvMap)73 static DECLCALLBACK(int) rtDbgModLdr_MapPart(PRTDBGMODINT pMod, uint32_t iDbgInfo, RTFOFF off, size_t cb, void const **ppvMap) 74 74 { 75 75 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; … … 79 79 return VERR_NO_MEMORY; 80 80 81 int rc = rtLdrReadAt(pThis->hLdrMod, pvMap, off, cb);81 int rc = rtLdrReadAt(pThis->hLdrMod, pvMap, iDbgInfo, off, cb); 82 82 if (RT_SUCCESS(rc)) 83 83 *ppvMap = pvMap; … … 96 96 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; 97 97 return RTLdrSize(pThis->hLdrMod); 98 } 99 100 101 /** @interface_method_impl{RTDBGMODVTIMG,pfnRvaToSegOffset} */ 102 static DECLCALLBACK(int) rtDbgModLdr_RvaToSegOffset(PRTDBGMODINT pMod, RTLDRADDR uRva, 103 PRTDBGSEGIDX piSeg, PRTLDRADDR poffSeg) 104 { 105 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; 106 return RTLdrRvaToSegOffset(pThis->hLdrMod, uRva, piSeg, poffSeg); 98 107 } 99 108 … … 176 185 /*.pfnGetLoadedSize = */ rtDbgModLdr_GetLoadedSize, 177 186 /*.pfnLinkAddressToSegOffset = */ rtDbgModLdr_LinkAddressToSegOffset, 187 /*.pfnRvaToSegOffset= */ rtDbgModLdr_RvaToSegOffset, 178 188 /*.pfnMapPart = */ rtDbgModLdr_MapPart, 179 189 /*.pfnUnmapPart = */ rtDbgModLdr_UnmapPart,
Note:
See TracChangeset
for help on using the changeset viewer.