llvm-project/llvm/lib/DebugInfo/PDB
Zachary Turner 579264bd59 Support skewed stream arrays.
VarStreamArray was built on the assumption that it is backed by a
StreamRef, and offset 0 of that StreamRef is the first byte of the first
record in the array.

This is a logical and intuitive assumption, but unfortunately we have
use cases where it doesn't hold. Specifically, a PDB module's symbol
stream is prefixed by 4 bytes containing a magic value, and the first
byte of record data in the array is actually at offset 4 of this byte
sequence.

Previously, we would just truncate the first 4 bytes and then construct
the VarStreamArray with the resulting StreamRef, so that offset 0 of the
underlying stream did correspond to the first byte of the first record,
but this is problematic, because symbol records reference other symbol
records by the absolute offset including that initial magic 4 bytes. So
if another record wants to refer to the first record in the array, it
would say "the record at offset 4".

This led to extremely confusing hacks and semantics in loading code, and
after spending 30 minutes trying to get some math right and failing, I
decided to fix this in the underlying implementation of VarStreamArray.
Now, we can say that a stream is skewed by a particular amount. This
way, when we access a record by absolute offset, we can use the same
values that the records themselves contain, instead of having to do
fixups.

Differential Revision: https://reviews.llvm.org/D55344

llvm-svn: 348499
2018-12-06 16:55:00 +00:00
..
DIA [PDB] Fix -Wunused-private-field in DIA 2018-10-23 17:20:16 +00:00
Native Support skewed stream arrays. 2018-12-06 16:55:00 +00:00
CMakeLists.txt Revert "Revert "[PDB] Extend IPDBSession's interface to retrieve frame data"" 2018-10-23 08:14:53 +00:00
GenericError.cpp [LLD] Fix Microsoft precompiled headers cross-compile on Linux 2018-11-08 14:42:37 +00:00
IPDBSourceFile.cpp
LLVMBuild.txt
PDB.cpp [DebugInfo] Common behavior for error types 2018-08-31 17:41:58 +00:00
PDBContext.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
PDBExtras.cpp [PDB] Add support for more kinds of PDB Sym Tags. 2018-10-01 22:39:19 +00:00
PDBInterfaceAnchors.cpp Revert "Revert "[PDB] Extend IPDBSession's interface to retrieve frame data"" 2018-10-23 08:14:53 +00:00
PDBSymDumper.cpp
PDBSymbol.cpp [PDB] Better support for enumerating pointer types. 2018-09-18 16:35:05 +00:00
PDBSymbolAnnotation.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolBlock.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolCompiland.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolCompilandDetails.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolCompilandEnv.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolCustom.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolData.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolExe.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolFunc.cpp [PDB] Remove all clone() methods. 2018-09-12 22:57:03 +00:00
PDBSymbolFuncDebugEnd.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolFuncDebugStart.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolLabel.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolPublicSymbol.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolThunk.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeArray.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeBaseClass.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeBuiltin.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeCustom.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeDimension.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeEnum.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeFriend.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeFunctionArg.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeFunctionSig.cpp [PDB] Remove all clone() methods. 2018-09-12 22:57:03 +00:00
PDBSymbolTypeManaged.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypePointer.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeTypedef.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeUDT.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeVTable.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolTypeVTableShape.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolUnknown.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
PDBSymbolUsingNamespace.cpp [PDB] Refactor the PDB symbol classes to fix a reuse bug. 2018-09-05 23:30:38 +00:00
UDTLayout.cpp [CodeView, PDB] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-06-30 23:06:03 +00:00