[llvm-dev] PDB questions

Andrew Kelley via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 30 23:17:03 PDT 2018


Zachary,

Thanks for the help on IRC earlier. I've got code that can capture a stack
trace and then discover for each address, its module, function, source
index, line, and column.

I still have a couple of loose ends though. Do you know what's going on
here?

1. There appears to be 8 bytes before every LineFragmentHeader. Here's some
of my own debug output, which matches llvm-pdbutil's output. You can see it
says "unknown bytes: ...".

read C13 line info 136720 bytes
unknown bytes: f2 00 00 00  60 00 00 00
LineFragmentHeader{ .RelocOffset = 0, .RelocSegment = 5, .Flags =
LineFlags{ .LF_HaveColumns = true, .unused = 0 }, .CodeSize = 52 }
has column: true
LineBlockFragmentHeader{ .NameIndex = 0, .NumLines = 6, .BlockSize = 84 }
LineNumberEntry{ .Offset = 0, .Flags = 101 } Flags{ .Start = 101, .End =
17, .IsStatement = false }
<snip some LineNumberEntry's>
ColumnNumberEntry{ .StartColumn = 5, .EndColumn = 0 }
ColumnNumberEntry{ .StartColumn = 30, .EndColumn = 0 }
unknown bytes: f2 00 00 00  f0 00 00 00
LineFragmentHeader{ .RelocOffset = 64, .RelocSegment = 5, .Flags =
LineFlags{ .LF_HaveColumns = true, .unused = 0 }, .CodeSize = 366 }
has column: true
LineBlockFragmentHeader{ .NameIndex = 8, .NumLines = 18, .BlockSize = 228 }
LineNumberEntry{ .Offset = 0, .Flags = 53 } Flags{ .Start = 53, .End = 20,
.IsStatement = false }
LineNumberEntry{ .Offset = 20, .Flags = 54 } Flags{ .Start = 54, .End = 24,
.IsStatement = false }
<etc>

Do you know what's going on with these 8 bytes? I have scoured
llvm-pdbutil's source but I cannot find where these bytes are coming from.

2. Is there a simpler way to find out which is the /names (string table)
stream index without porting the entire hash table implementation?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180831/f7076f32/attachment.html>


More information about the llvm-dev mailing list