| 1861 | } |
| 1862 | |
| 1863 | void COFF::ParseTypeData(CvStreamReader& reader, int dataOffset) |
| 1864 | { |
| 1865 | BP_ZONE("COFF::ParseTypeData"); |
| 1866 | |
| 1867 | //uint8* sectionEnd = sectionData + sectionSize; |
| 1868 | //uint8* data = sectionData; |
| 1869 | |
| 1870 | if (mCvMinTag == -1) |
| 1871 | mCvMinTag = 0x1000; |
| 1872 | |
| 1873 | int offset = dataOffset; |
| 1874 | |
| 1875 | bool isTagMapEmpty = mCvTagStartMap.empty(); |
| 1876 | for (int tagIdx = mCvMinTag; true; tagIdx++) |
| 1877 | { |
| 1878 | if (tagIdx == mCvMaxTag) |
| 1879 | break; |
| 1880 | if (offset >= reader.mSize) |
| 1881 | break; |
| 1882 | |
| 1883 | //OutputDebugStrF("%X %X\n", tagIdx, (int)(data - sectionData)); |
| 1884 | |
| 1885 | BF_ASSERT(((offset) & 3) == 0); |
| 1886 | |
| 1887 | //PTR_ALIGN(data, sectionData, 4); |
| 1888 | |
| 1889 | uint8* data = reader.GetTempPtr(offset, 4); |
| 1890 | uint16 trLength = *(uint16*)data; |
| 1891 | uint16 trLeafType = *(uint16*)(data + 2); |
| 1892 | |
| 1893 | // uint16 trLength = GET(uint16); |
| 1894 | // uint8* dataStart = data; |
| 1895 | // uint16 trLeafType = GET(uint16); |
| 1896 | // uint8* dataEnd = dataStart + trLength; |
| 1897 | |
| 1898 | if (isTagMapEmpty) |
| 1899 | { |
| 1900 | mCvTagStartMap.push_back(offset); |
| 1901 | mCvTypeMap.push_back(NULL); |
| 1902 | } |
| 1903 | else |
| 1904 | mCvTagStartMap[tagIdx - mCvMinTag] = offset; |
| 1905 | |
| 1906 | offset += trLength + 2; |
| 1907 | |
| 1908 | DbgType* dbgType = NULL; |
| 1909 | |
| 1910 | if (trLeafType == 0) |
| 1911 | continue; |
| 1912 | |
| 1913 | if ((trLeafType == LF_ENUM) || (trLeafType == LF_CLASS) || (trLeafType == LF_STRUCTURE) || (trLeafType == LF_UNION) || |
| 1914 | (trLeafType == LF_CLASS_EX) || (trLeafType == LF_STRUCTURE_EX)) |
| 1915 | { |
| 1916 | CvParseType(tagIdx); |
| 1917 | } |
| 1918 | } |
| 1919 | |
| 1920 | if (isTagMapEmpty) |