- Timestamp:
- Jul 27, 2018 7:59:25 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123993
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r73365 r73375 746 746 RTUUID Uuid; 747 747 PRTUUID pUuid = &Uuid; 748 rc = pDbgMod->pImgVt->pfnQueryProp(pDbgMod, RTLDRPROP_UUID, &Uuid, sizeof(Uuid) );748 rc = pDbgMod->pImgVt->pfnQueryProp(pDbgMod, RTLDRPROP_UUID, &Uuid, sizeof(Uuid), NULL); 749 749 if (RT_FAILURE(rc)) 750 750 pUuid = NULL; … … 1269 1269 { 1270 1270 RTUUID UuidOpened; 1271 rc = pDbgMod->pImgVt->pfnQueryProp(pDbgMod, RTLDRPROP_UUID, &UuidOpened, sizeof(UuidOpened) );1271 rc = pDbgMod->pImgVt->pfnQueryProp(pDbgMod, RTLDRPROP_UUID, &UuidOpened, sizeof(UuidOpened), NULL); 1272 1272 if (RT_SUCCESS(rc)) 1273 1273 { … … 1648 1648 1649 1649 1650 RTDECL(uint64_t) RTDbgModGetTag(RTDBGMOD hDbgMod) 1651 { 1652 PRTDBGMODINT pDbgMod = hDbgMod; 1653 RTDBGMOD_VALID_RETURN_RC(pDbgMod, 0); 1654 return pDbgMod->uTag; 1655 } 1656 RT_EXPORT_SYMBOL(RTDbgModGetTag); 1657 1658 1659 RTDECL(int) RTDbgModSetTag(RTDBGMOD hDbgMod, uint64_t uTag) 1660 { 1661 PRTDBGMODINT pDbgMod = hDbgMod; 1662 RTDBGMOD_VALID_RETURN_RC(pDbgMod, VERR_INVALID_HANDLE); 1663 RTDBGMOD_LOCK(pDbgMod); 1664 1665 pDbgMod->uTag = uTag; 1666 1667 RTDBGMOD_UNLOCK(pDbgMod); 1668 return VINF_SUCCESS; 1669 } 1670 RT_EXPORT_SYMBOL(RTDbgModSetTag); 1671 1672 1650 1673 RTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod) 1651 1674 { … … 1662 1685 1663 1686 1664 RTDECL(uint64_t) RTDbgModGetTag(RTDBGMOD hDbgMod) 1665 { 1666 PRTDBGMODINT pDbgMod = hDbgMod; 1667 RTDBGMOD_VALID_RETURN_RC(pDbgMod, 0); 1668 return pDbgMod->uTag; 1669 } 1670 RT_EXPORT_SYMBOL(RTDbgModGetTag); 1671 1672 1673 RTDECL(int) RTDbgModSetTag(RTDBGMOD hDbgMod, uint64_t uTag) 1687 RTDECL(RTLDRFMT) RTDbgModImageGetFormat(RTDBGMOD hDbgMod) 1688 { 1689 PRTDBGMODINT pDbgMod = hDbgMod; 1690 RTDBGMOD_VALID_RETURN_RC(pDbgMod, RTLDRFMT_INVALID); 1691 RTDBGMOD_LOCK(pDbgMod); 1692 1693 RTLDRFMT enmFmt; 1694 if ( pDbgMod->pImgVt 1695 && pDbgMod->pImgVt->pfnGetFormat) 1696 enmFmt = pDbgMod->pImgVt->pfnGetFormat(pDbgMod); 1697 else 1698 enmFmt = RTLDRFMT_INVALID; 1699 1700 RTDBGMOD_UNLOCK(pDbgMod); 1701 return enmFmt; 1702 } 1703 RT_EXPORT_SYMBOL(RTDbgModImageGetFormat); 1704 1705 1706 RTDECL(RTLDRARCH) RTDbgModImageGetArch(RTDBGMOD hDbgMod) 1707 { 1708 PRTDBGMODINT pDbgMod = hDbgMod; 1709 RTDBGMOD_VALID_RETURN_RC(pDbgMod, RTLDRARCH_INVALID); 1710 RTDBGMOD_LOCK(pDbgMod); 1711 1712 RTLDRARCH enmArch; 1713 if ( pDbgMod->pImgVt 1714 && pDbgMod->pImgVt->pfnGetArch) 1715 enmArch = pDbgMod->pImgVt->pfnGetArch(pDbgMod); 1716 else 1717 enmArch = RTLDRARCH_WHATEVER; 1718 1719 RTDBGMOD_UNLOCK(pDbgMod); 1720 return enmArch; 1721 } 1722 RT_EXPORT_SYMBOL(RTDbgModImageGetArch); 1723 1724 1725 RTDECL(int) RTDbgModImageQueryProp(RTDBGMOD hDbgMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf, size_t *pcbRet) 1674 1726 { 1675 1727 PRTDBGMODINT pDbgMod = hDbgMod; 1676 1728 RTDBGMOD_VALID_RETURN_RC(pDbgMod, VERR_INVALID_HANDLE); 1729 AssertPtrNullReturn(pcbRet, VERR_INVALID_POINTER); 1677 1730 RTDBGMOD_LOCK(pDbgMod); 1678 1731 1679 pDbgMod->uTag = uTag; 1732 int rc; 1733 if ( pDbgMod->pImgVt 1734 && pDbgMod->pImgVt->pfnQueryProp) 1735 rc = pDbgMod->pImgVt->pfnQueryProp(pDbgMod, enmProp, pvBuf, cbBuf, pcbRet); 1736 else 1737 rc = VERR_NOT_FOUND; 1680 1738 1681 1739 RTDBGMOD_UNLOCK(pDbgMod); 1682 return VINF_SUCCESS;1683 } 1684 RT_EXPORT_SYMBOL(RTDbgMod SetTag);1740 return rc; 1741 } 1742 RT_EXPORT_SYMBOL(RTDbgModImageQueryProp); 1685 1743 1686 1744 -
trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
r73359 r73375 445 445 446 446 /** @interface_method_impl{RTDBGMODVTIMG,pfnQueryProp} */ 447 static DECLCALLBACK(int ) rtDbgModDeferredImg_QueryProp(PRTDBGMODINT pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf) 448 { 449 int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/); 450 if (RT_SUCCESS(rc)) 451 rc = pMod->pImgVt->pfnQueryProp(pMod, enmProp, pvBuf, cbBuf); 447 static DECLCALLBACK(int) 448 rtDbgModDeferredImg_QueryProp(PRTDBGMODINT pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf, size_t *pcbRet) 449 { 450 int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/); 451 if (RT_SUCCESS(rc)) 452 rc = pMod->pImgVt->pfnQueryProp(pMod, enmProp, pvBuf, cbBuf, pcbRet); 452 453 return rc; 453 454 } -
trunk/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
r69111 r73375 62 62 63 63 /** @interface_method_impl{RTDBGMODVTIMG,pfnQueryProp} */ 64 static DECLCALLBACK(int) rtDbgModLdr_QueryProp(PRTDBGMODINT pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf )65 { 66 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; 67 return RTLdrQueryProp (pThis->hLdrMod, enmProp, pvBuf, cbBuf);64 static DECLCALLBACK(int) rtDbgModLdr_QueryProp(PRTDBGMODINT pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf, size_t *pcbRet) 65 { 66 PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv; 67 return RTLdrQueryPropEx(pThis->hLdrMod, enmProp, NULL /*pvBits*/, pvBuf, cbBuf, pcbRet); 68 68 } 69 69 -
trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp
r73150 r73375 635 635 break; 636 636 case RTLDRPROP_INTERNAL_NAME: 637 case RTLDRPROP_UNWIND_INFO: 637 638 *pcbRet = 0; 638 639 break; -
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r73150 r73375 122 122 /** The security directory entry. */ 123 123 IMAGE_DATA_DIRECTORY SecurityDir; 124 /** The exception data directory entry. */ 125 IMAGE_DATA_DIRECTORY ExceptionDir; 124 126 125 127 /** Offset of the first PKCS \#7 SignedData signature if present. */ … … 1917 1919 1918 1920 /** 1919 * Worker for rtLdrPE_QueryProp that retriev s the internal module name.1921 * Worker for rtLdrPE_QueryProp that retrieves the internal module name. 1920 1922 * 1921 1923 * @returns IPRT status code. If VERR_BUFFER_OVERFLOW, pcbBuf is required size. … … 1944 1946 } 1945 1947 1948 return rc; 1949 } 1950 1951 1952 /** 1953 * Worker for rtLdrPE_QueryProp that retrieves unwind information. 1954 * 1955 * @returns IPRT status code. If VERR_BUFFER_OVERFLOW, pcbBuf is required size. 1956 * @param pThis The PE module instance. 1957 * @param pvBits Image bits if the caller had them available, NULL if 1958 * not. Saves a couple of file accesses. 1959 * @param pvBuf The output buffer. 1960 * @param cbBuf The buffer size. 1961 * @param pcbRet Where to return the number of bytes we've returned 1962 * (or in case of VERR_BUFFER_OVERFLOW would have). 1963 */ 1964 static int rtLdrPE_QueryUnwindInfo(PRTLDRMODPE pThis, void const *pvBits, void *pvBuf, size_t cbBuf, size_t *pcbRet) 1965 { 1966 int rc; 1967 uint32_t const cbSrc = pThis->ExceptionDir.Size; 1968 if ( cbSrc > 0 1969 && pThis->ExceptionDir.VirtualAddress > 0) 1970 { 1971 *pcbRet = cbSrc; 1972 if (cbBuf >= cbSrc) 1973 { 1974 void const *pvSrc = NULL; 1975 rc = rtldrPEReadPartByRva(pThis, pvBits, pThis->ExceptionDir.VirtualAddress, cbSrc, &pvSrc); 1976 if (RT_SUCCESS(rc)) 1977 { 1978 memcpy(pvBuf, pvSrc, cbSrc); 1979 rtldrPEFreePart(pThis, pvBits, pvSrc); 1980 } 1981 } 1982 else 1983 rc = VERR_BUFFER_OVERFLOW; 1984 } 1985 else 1986 { 1987 *pcbRet = 0; 1988 rc = VERR_NOT_FOUND; 1989 } 1946 1990 return rc; 1947 1991 } … … 2017 2061 case RTLDRPROP_INTERNAL_NAME: 2018 2062 return rtLdrPE_QueryInternalName(pModPe, pvBits, pvBuf, cbBuf, pcbRet); 2063 2064 case RTLDRPROP_UNWIND_INFO: 2065 return rtLdrPE_QueryUnwindInfo(pModPe, pvBits, pvBuf, cbBuf, pcbRet); 2019 2066 2020 2067 default: … … 4033 4080 pModPe->DebugDir = OptHdr.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG]; 4034 4081 pModPe->SecurityDir = OptHdr.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; 4082 pModPe->ExceptionDir = OptHdr.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION]; 4035 4083 pModPe->fDllCharacteristics = OptHdr.DllCharacteristics; 4036 4084 -
trunk/src/VBox/Runtime/include/internal/dbgmod.h
r69111 r73375 236 236 * @param pvBuf Pointer to the return buffer. 237 237 * @param cbBuf The size of the return buffer. 238 * @sa RTLdrQueryProp 239 */ 240 DECLCALLBACKMEMBER(int, pfnQueryProp)(PRTDBGMODINT pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf); 238 * @param pcbRet How many bytes was actually returned. In the 239 * case of VERR_BUFFER_OVERFLOW this will contain 240 * the required buffer size. Optional. 241 * @sa RTLdrQueryPropEx 242 */ 243 DECLCALLBACKMEMBER(int, pfnQueryProp)(PRTDBGMODINT pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf, size_t *pcbRet); 241 244 242 245 /** For catching initialization errors (RTDBGMODVTIMG_MAGIC). */
Note:
See TracChangeset
for help on using the changeset viewer.