[PATCH] D64879: llvm-pdbdump: Fix several smaller issues with injected source compression handling
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 17 15:24:03 PDT 2019
thakis marked an inline comment as done.
thakis added a comment.
Thanks!
================
Comment at: llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp:20
-Expected<std::string> readStreamData(BinaryStream &Stream) {
- uint32_t Offset = 0, DataLength = Stream.getLength();
+Expected<std::string> readStreamData(BinaryStream &Stream, uint64_t Limit) {
+ uint32_t Offset = 0;
----------------
rnk wrote:
> Perhaps Limit should be uint32_t since PDBs have some inherent 32-bit size limitations, and this is PDB-specific code? It would avoid the casts for std::min.
You're completely right. I had done this because IPDBInjectedSource::getCodeByteSize() returns 64-bit, but Entry.FileSize is just 32 bits.
getCodeByteSize() returns 64 bit because that's what the DIA version returns: https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/idiainjectedsource-get-length?view=vs-2019
But it also says "the same value as returned by the IDiaInjectedSource::get_source method" and that returns a DWORD. Weird that dia returns 64-bit. Anyhow, changed just this function here to take a uint32_t, and I'm now passing in Entry.FileSize.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64879/new/
https://reviews.llvm.org/D64879
More information about the llvm-commits
mailing list