Changeset 60269 in vbox for trunk/src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp
- Timestamp:
- Mar 31, 2016 9:54:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp
r60266 r60269 823 823 static int rtDbgModCvSsProcessV8SrcStrings(PRTDBGMODCV pThis, void const *pvSrcStrings, size_t cbSrcStrings, uint32_t fFlags) 824 824 { 825 if (pThis->cbSrcStrings) 826 Log(("\n!!More than one source file string table for this module!!\n\n")); 827 825 828 if (cbSrcStrings >= pThis->cbSrcStringsAlloc) 826 829 { … … 865 868 static int rtDbgModCvSsProcessV8SrcInfo(PRTDBGMODCV pThis, void const *pvSrcInfo, size_t cbSrcInfo, uint32_t fFlags) 866 869 { 870 if (pThis->cbSrcInfo) 871 Log(("\n!!More than one source file info table for this module!!\n\n")); 872 867 873 if (cbSrcInfo + sizeof(RTCV8SRCINFO) > pThis->cbSrcInfoAlloc) 868 874 { … … 876 882 pThis->cbSrcInfo = cbSrcInfo; 877 883 Log2((" saved %#x bytes of CV8 source file info\n", cbSrcInfo)); 878 879 if (LogIs3Enabled())880 {881 size_t iFile = 0;882 size_t off = 0;883 while (off + 4 <= cbSrcInfo)884 {885 PCRTCV8SRCINFO pSrcInfo = (PCRTCV8SRCINFO)&pThis->pbSrcInfo[off];886 const char *pszName;887 if (pSrcInfo->offSourceName < pThis->cbDbgInfo)888 pszName = &pThis->pchSrcStrings[pSrcInfo->offSourceName];889 else890 pszName = "out-of-bounds.c!";891 if (pSrcInfo->uDigestType == RTCV8SRCINFO_DIGEST_TYPE_MD5)892 {893 Log3((" %010zx #%03zu: %RTuuid %#x=%s\n", off, iFile, &pSrcInfo->Digest.md5, pSrcInfo->offSourceName, pszName));894 off += sizeof(*pSrcInfo);895 }896 else897 {898 if (pSrcInfo->uDigestType == RTCV8SRCINFO_DIGEST_TYPE_NONE)899 Log3((" %010zx #%03zu: <none> %#x=%s\n", off, iFile, pSrcInfo->offSourceName, pszName));900 else901 Log3((" %010zx #%03zu: !%#x! %#x=%s\n", off, iFile, pSrcInfo->uDigestType, pSrcInfo->offSourceName, pszName));902 off += 8;903 }904 iFile++;905 }906 }907 908 884 return VINF_SUCCESS; 909 885 } … … 996 972 static int rtDbgModCvSsProcessV8SymTab(PRTDBGMODCV pThis, void const *pvSymTab, size_t cbSymTab, uint32_t fFlags) 997 973 { 998 int rc = VINF_SUCCESS; 974 size_t const cbSymTabSaved = cbSymTab; 975 int rc = VINF_SUCCESS; 976 977 /* 978 * First pass looks for source information and source strings tables. 979 * Microsoft puts the 0xf3 and 0xf4 last, usually with 0xf4 first. 980 * 981 * We ASSUME one string and one info table per module! 982 */ 999 983 RTCPTRUNION uCursor; 1000 984 uCursor.pv = pvSymTab; 1001 1002 985 for (;;) 1003 986 { 1004 987 RTDBGMODCV_CHECK_RET_BF(cbSymTab > sizeof(RTCV8SYMBOLSBLOCK), ("cbSymTab=%zu\n", cbSymTab)); 1005 988 PCRTCV8SYMBOLSBLOCK pBlockHdr = (PCRTCV8SYMBOLSBLOCK)uCursor.pv; 1006 Log3((" %p: uType=%#04x LB %#x\n", (uint8_t *)pBlockHdr - (uint8_t *)pvSymTab, pBlockHdr->uType, pBlockHdr->cb)); 989 Log3((" %p: pass #1 uType=%#04x LB %#x\n", (uint8_t *)pBlockHdr - (uint8_t *)pvSymTab, pBlockHdr->uType, pBlockHdr->cb)); 990 RTDBGMODCV_CHECK_RET_BF(pBlockHdr->cb <= cbSymTab - sizeof(RTCV8SYMBOLSBLOCK), 991 ("cb=%#u cbSymTab=%zu\n", pBlockHdr->cb, cbSymTab)); 992 993 switch (pBlockHdr->uType) 994 { 995 case RTCV8SYMBLOCK_TYPE_SRC_STR: 996 rc = rtDbgModCvSsProcessV8SrcStrings(pThis, pBlockHdr + 1, pBlockHdr->cb, fFlags); 997 break; 998 999 case RTCV8SYMBLOCK_TYPE_SRC_INFO: 1000 rc = rtDbgModCvSsProcessV8SrcInfo(pThis, pBlockHdr + 1, pBlockHdr->cb, fFlags); 1001 break; 1002 1003 case RTCV8SYMBLOCK_TYPE_SECT_LINES: 1004 case RTCV8SYMBLOCK_TYPE_SYMBOLS: 1005 break; 1006 default: 1007 Log(("rtDbgModCvSsProcessV8SymTab: Unknown block type %#x (LB %#x)\n", pBlockHdr->uType, pBlockHdr->cb)); 1008 break; 1009 } 1010 uint32_t cbAligned = RT_ALIGN_32(sizeof(*pBlockHdr) + pBlockHdr->cb, 4); 1011 if (RT_SUCCESS(rc) && cbSymTab > cbAligned) 1012 { 1013 uCursor.pu8 += cbAligned; 1014 cbSymTab -= cbAligned; 1015 } 1016 else 1017 break; 1018 } 1019 1020 /* 1021 * Log the source info now that we've gathered both it and the strings. 1022 */ 1023 if (LogIs3Enabled() && pThis->cbSrcInfo) 1024 { 1025 Log3((" Source file info table:\n")); 1026 size_t iFile = 0; 1027 size_t off = 0; 1028 while (off + 4 <= pThis->cbSrcInfo) 1029 { 1030 PCRTCV8SRCINFO pSrcInfo = (PCRTCV8SRCINFO)&pThis->pbSrcInfo[off]; 1031 const char *pszName = pSrcInfo->offSourceName < pThis->cbSrcStrings 1032 ? &pThis->pchSrcStrings[pSrcInfo->offSourceName] : "out-of-bounds.c!"; 1033 if (pSrcInfo->uDigestType == RTCV8SRCINFO_DIGEST_TYPE_MD5) 1034 Log3((" %010zx #%03zu: %RTuuid %#x=%s\n", off, iFile, &pSrcInfo->Digest.md5, pSrcInfo->offSourceName, pszName)); 1035 else if (pSrcInfo->uDigestType == RTCV8SRCINFO_DIGEST_TYPE_NONE) 1036 Log3((" %010zx #%03zu: <none> %#x=%s\n", off, iFile, pSrcInfo->offSourceName, pszName)); 1037 else 1038 Log3((" %010zx #%03zu: !%#x! %#x=%s\n", off, iFile, pSrcInfo->uDigestType, pSrcInfo->offSourceName, pszName)); 1039 off += pSrcInfo->uDigestType == RTCV8SRCINFO_DIGEST_TYPE_MD5 ? sizeof(*pSrcInfo) : 8; 1040 iFile++; 1041 } 1042 } 1043 1044 /* 1045 * Second pass, process symbols and line numbers. 1046 */ 1047 uCursor.pv = pvSymTab; 1048 cbSymTab = cbSymTabSaved; 1049 for (;;) 1050 { 1051 RTDBGMODCV_CHECK_RET_BF(cbSymTab > sizeof(RTCV8SYMBOLSBLOCK), ("cbSymTab=%zu\n", cbSymTab)); 1052 PCRTCV8SYMBOLSBLOCK pBlockHdr = (PCRTCV8SYMBOLSBLOCK)uCursor.pv; 1053 Log3((" %p: pass #2 uType=%#04x LB %#x\n", (uint8_t *)pBlockHdr - (uint8_t *)pvSymTab, pBlockHdr->uType, pBlockHdr->cb)); 1007 1054 RTDBGMODCV_CHECK_RET_BF(pBlockHdr->cb <= cbSymTab - sizeof(RTCV8SYMBOLSBLOCK), 1008 1055 ("cb=%#u cbSymTab=%zu\n", pBlockHdr->cb, cbSymTab)); … … 1014 1061 break; 1015 1062 1016 case RTCV8SYMBLOCK_TYPE_SRC_STR:1017 rc = rtDbgModCvSsProcessV8SrcStrings(pThis, pBlockHdr + 1, pBlockHdr->cb, fFlags);1018 break;1019 1020 1063 case RTCV8SYMBLOCK_TYPE_SECT_LINES: 1021 1064 rc = rtDbgModCvSsProcessV8SectLines(pThis, pBlockHdr + 1, pBlockHdr->cb, fFlags); … … 1023 1066 1024 1067 case RTCV8SYMBLOCK_TYPE_SRC_INFO: 1025 rc = rtDbgModCvSsProcessV8SrcInfo(pThis, pBlockHdr + 1, pBlockHdr->cb, fFlags);1068 case RTCV8SYMBLOCK_TYPE_SRC_STR: 1026 1069 break; 1027 1070 default:
Note:
See TracChangeset
for help on using the changeset viewer.