[PATCH] D50258: [llvm-pdbutil] Support PDBs without a DBI stream
Alexandre Ganea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 6 08:35:59 PDT 2018
aganea marked 5 inline comments as done.
aganea added inline comments.
================
Comment at: lib/DebugInfo/PDB/Native/PDBFile.cpp:473-474
+ assert(StreamIndex < Layout.StreamSizes.size() && "Invalid stream index");
+ if (Layout.StreamSizes[StreamIndex] == 0)
+ return make_error<RawError>(raw_error_code::no_stream);
return MappedBlockStream::createIndexedStream(Layout, MsfData, StreamIndex,
----------------
zturner wrote:
> This check looks incorrect to me. A 0-byte stream is still a stream.
Reverted this change - replaced by change in InputFile.cpp instead.
================
Comment at: test/tools/llvm-pdbdump/Inputs/TypeServerTest.cpp:1
+// Compile with "cl /c /Zi TypeServerTest.cpp /FdTypeServerTest.pdb"
+
----------------
zturner wrote:
> Instead of checking in source code and a binary object file, can we just check in a yaml file and run it through yaml2pdb? If you can't get pdb2yaml to produce this file (because it also crashes), then just run pdb2yaml on a good file, and delete the DBI stream. If it's possible to get pdb2yaml to produce a PDB with a 0-byte DBI stream, that should be sufficient to test this.
>
> If all else fails and you really must check in binary files, then I think we only need the PDB and not the obj, and you will probably need to use `/nodefaultlib /entry:main` to keep the PDB binary small.
Unfourtunately the pdb is needed, because yaml2pdb generates a default DBI stream if there's none in the yaml. Also, please note this is the pdb generated by **cl.exe**, not link.exe. The current size is 60kb.
Repository:
rL LLVM
https://reviews.llvm.org/D50258
More information about the llvm-commits
mailing list