You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bool res = pdb.enumerateLineNumbers(uint32_t(rva), rangeSize, lines, files);
258
-
for(constauto & line : lines)
254
+
if(files.size() == 1)
255
+
{
256
+
GuiSymbolLogAdd(StringUtils::sprintf("[%p, %s] Since there is only one file, attempting line overflow detection..\n", _imageBase, _modname.c_str()).c_str());
257
+
258
+
// This is a super hack to adjust for the (undocumented) limit of 16777215 lines (unsigned 24 bits maximum).
259
+
// It is unclear at this point if yasm/coff/link/pdb is causing this issue.
260
+
// We can fix this because there is only a single source file and the returned result is sorted by *both* rva/line (IMPORTANT!).
261
+
// For supporting multiple source files in the future we could need multiple 'lineOverflow' variables.
if((line.lineNumber & 0xfffff0) == 0 && (maxLine & 0xfffffff0) == (overflowValue & 0xfffffff0)) // allow 16 lines of play, perhaps there is a label/comment on line 0xffffff+1
267
+
{
268
+
GuiSymbolLogAdd(StringUtils::sprintf("[%p, %s] Line number overflow detected (%u -> %u), adjusting with hacks...\n", _imageBase, _modname.c_str(), maxLine, line.lineNumber).c_str());
found = _sourceIdMap.insert({ sourceFileId, uint32_t(idx) }).first;
275
+
GuiSymbolLogAdd(StringUtils::sprintf("[%p, %s] The line information is not sorted by line (violated assumption)! lineNumber: %u, maxLine: %u\n", _imageBase, _modname.c_str(), line.lineNumber, maxLine).c_str());
279
276
}
280
-
lineInfo.sourceFileIdx = found->second;
277
+
maxLine = line.lineNumber;
278
+
if(!(line.rva > maxRva))
279
+
{
280
+
GuiSymbolLogAdd(StringUtils::sprintf("[%p, %s] The line information is not sorted by rva (violated assumption)! rva: 0x%x, maxRva: 0x%x\n", _imageBase, _modname.c_str(), line.rva, maxRva).c_str());
0 commit comments