pdb
pdb copied to clipboard
Take advantage of the type index offset data
From LLVM:
/// Type streams in PDBs contain an additional field which is a list of pairs
/// containing indices and their corresponding offsets, roughly every ~8KB of
/// record data. This general idea need not be confined to PDBs though. By
/// supplying such an array, the producer of a type stream can allow the
/// consumer much better access time, because the consumer can find the nearest
/// index in this array, and do a linear scan forward only from there.
This data is referenced in the header here: https://github.com/willglynn/pdb/blob/b052964e09d03eb190c8a60dc76344150ff8a9df/src/tpi/header.rs#L31
ItemFinder
currently builds such an index -> offset map itself (in the positions
Vec). It would be great if it could use this existing table.
For reference, here is the link to the LLVM code cited by OP: https://github.com/llvm/llvm-project/blob/962c306a11d0a21c884c12e18825b8a41ba1bd7d/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h#L35-L40