Changeset 46134 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- May 16, 2013 11:32:06 PM (12 years ago)
- Location:
- trunk/src/VBox/Runtime/common/dbg
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgas.cpp
r44529 r46134 395 395 } 396 396 RT_EXPORT_SYMBOL(RTDbgAsRelease); 397 398 399 RTDECL(int) RTDbgAsLockExcl(RTDBGAS hDbgAs) 400 { 401 PRTDBGASINT pDbgAs = hDbgAs; 402 RTDBGAS_VALID_RETURN_RC(pDbgAs, VERR_INVALID_HANDLE); 403 RTDBGAS_LOCK_WRITE(pDbgAs); 404 return VINF_SUCCESS; 405 } 406 RT_EXPORT_SYMBOL(RTDbgAsLockExcl); 407 408 409 RTDECL(int) RTDbgAsUnlockExcl(RTDBGAS hDbgAs) 410 { 411 PRTDBGASINT pDbgAs = hDbgAs; 412 RTDBGAS_VALID_RETURN_RC(pDbgAs, VERR_INVALID_HANDLE); 413 RTDBGAS_UNLOCK_WRITE(pDbgAs); 414 return VINF_SUCCESS; 415 } 416 RT_EXPORT_SYMBOL(RTDbgAsUnlockExcl); 397 417 398 418 -
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r46109 r46134 1161 1161 1162 1162 1163 RTDECL(int) RTDbgModRemoveAll(RTDBGMOD hDbgMod, bool fLeaveSegments) 1164 { 1165 PRTDBGMODINT pDbgMod = hDbgMod; 1166 RTDBGMOD_VALID_RETURN_RC(pDbgMod, VERR_INVALID_HANDLE); 1167 1168 RTDBGMOD_LOCK(pDbgMod); 1169 1170 /* Only possible on container modules. */ 1171 int rc = VINF_SUCCESS; 1172 if (pDbgMod->pDbgVt != &g_rtDbgModVtDbgContainer) 1173 { 1174 if (fLeaveSegments) 1175 { 1176 rc = rtDbgModContainer_LineRemoveAll(pDbgMod); 1177 if (RT_SUCCESS(rc)) 1178 rc = rtDbgModContainer_SymbolRemoveAll(pDbgMod); 1179 } 1180 else 1181 rc = rtDbgModContainer_RemoveAll(pDbgMod); 1182 } 1183 else 1184 rc = VERR_ACCESS_DENIED; 1185 1186 RTDBGMOD_UNLOCK(pDbgMod); 1187 return rc; 1188 } 1189 1190 1163 1191 RTDECL(RTDBGSEGIDX) RTDbgModRvaToSegOff(RTDBGMOD hDbgMod, RTUINTPTR uRva, PRTUINTPTR poffSeg) 1164 1192 { -
trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
r46048 r46134 613 613 614 614 615 /** Destroy a line number node. */ 616 static DECLCALLBACK(int) rtDbgModContainer_DestroyTreeLineNode(PAVLU32NODECORE pNode, void *pvUser) 617 { 618 PRTDBGMODCTNLINE pLine = RT_FROM_MEMBER(pNode, RTDBGMODCTNLINE, OrdinalCore); 619 RTStrCacheRelease(g_hDbgModStrCache, pLine->pszFile); 620 pLine->pszFile = NULL; 621 RTMemFree(pLine); 622 NOREF(pvUser); 623 return 0; 624 } 625 626 615 627 /** Destroy a symbol node. */ 616 628 static DECLCALLBACK(int) rtDbgModContainer_DestroyTreeNode(PAVLRUINTPTRNODECORE pNode, void *pvUser) … … 643 655 pThis->Names = NULL; 644 656 657 RTAvlU32Destroy(&pThis->LineOrdinalTree, rtDbgModContainer_DestroyTreeLineNode, NULL); 658 645 659 RTMemFree(pThis->paSegs); 646 660 pThis->paSegs = NULL; … … 662 676 663 677 /** Virtual function table for the debug info container. */ 664 static RTDBGMODVTDBGconst g_rtDbgModVtDbgContainer =678 DECL_HIDDEN_CONST(RTDBGMODVTDBG) const g_rtDbgModVtDbgContainer = 665 679 { 666 680 /*.u32Magic = */ RTDBGMODVTDBG_MAGIC, … … 691 705 }; 692 706 707 708 709 /** 710 * Special container operation for removing all symbols. 711 * 712 * @returns IPRT status code. 713 * @param pMod The module instance. 714 */ 715 DECLHIDDEN(int) rtDbgModContainer_SymbolRemoveAll(PRTDBGMODINT pMod) 716 { 717 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 718 719 for (uint32_t iSeg = 0; iSeg < pThis->cSegs; iSeg++) 720 { 721 RTAvlrUIntPtrDestroy(&pThis->paSegs[iSeg].SymAddrTree, rtDbgModContainer_DestroyTreeNode, NULL); 722 Assert(pThis->paSegs[iSeg].SymAddrTree == NULL); 723 } 724 725 RTAvlrUIntPtrDestroy(&pThis->AbsAddrTree, rtDbgModContainer_DestroyTreeNode, NULL); 726 Assert(pThis->AbsAddrTree == NULL); 727 728 pThis->Names = NULL; 729 pThis->iNextSymbolOrdinal = 0; 730 731 return VINF_SUCCESS; 732 } 733 734 735 /** 736 * Special container operation for removing all line numbers. 737 * 738 * @returns IPRT status code. 739 * @param pMod The module instance. 740 */ 741 DECLHIDDEN(int) rtDbgModContainer_LineRemoveAll(PRTDBGMODINT pMod) 742 { 743 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 744 745 for (uint32_t iSeg = 0; iSeg < pThis->cSegs; iSeg++) 746 pThis->paSegs[iSeg].LineAddrTree = NULL; 747 748 RTAvlU32Destroy(&pThis->LineOrdinalTree, rtDbgModContainer_DestroyTreeLineNode, NULL); 749 Assert(pThis->LineOrdinalTree == NULL); 750 751 pThis->iNextLineOrdinal = 0; 752 753 return VINF_SUCCESS; 754 } 755 756 757 /** 758 * Special container operation for removing everything. 759 * 760 * @returns IPRT status code. 761 * @param pMod The module instance. 762 */ 763 DECLHIDDEN(int) rtDbgModContainer_RemoveAll(PRTDBGMODINT pMod) 764 { 765 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 766 767 rtDbgModContainer_LineRemoveAll(pMod); 768 rtDbgModContainer_SymbolRemoveAll(pMod); 769 770 for (uint32_t iSeg = 0; iSeg < pThis->cSegs; iSeg++) 771 { 772 RTStrCacheRelease(g_hDbgModStrCache, pThis->paSegs[iSeg].pszName); 773 pThis->paSegs[iSeg].pszName = NULL; 774 } 775 776 pThis->cSegs = 0; 777 pThis->cb = 0; 778 779 return VINF_SUCCESS; 780 } 693 781 694 782
Note:
See TracChangeset
for help on using the changeset viewer.