[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 12:40:48 PDT 2019
thakis created this revision.
thakis added a reviewer: rnk.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
- getCompression() used to return a PDB_SourceCompression even though the docs for IDiaInjectedSource are explicit about the return value being compiler-dependent. Return an uint32_t instead, and make the printing code handle unknown values better by printing "Unknown" and the int value instead of not printing any compression.
- Print compressed contents as hex dump, not as string.
- Add compression type "DotNet", which is used (at least) by csc.exe, the C# compiler. Also add a lengthy comment describing the stream contents (derived from looking at the raw hex contents long enough to see the GUIDs, which led me to the roslyn and mono implementations for handling this).
- The native injected source dumper was dumping the contents of the whole data stream -- but csc.exe writes a stream that's padded with zero bytes to the next 512 boundary, and the dia api doesn't display those padding bytes. So make NativeInjectedSource::getCode() do the same thing.
https://reviews.llvm.org/D64879
Files:
llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
llvm/lib/DebugInfo/PDB/PDBExtras.cpp
llvm/test/tools/llvm-pdbutil/Inputs/dotnet_contents_compressed.pdb
llvm/test/tools/llvm-pdbutil/Inputs/dotnet_contents_uncompressed.pdb
llvm/test/tools/llvm-pdbutil/Inputs/dotnet_hashonly.pdb
llvm/test/tools/llvm-pdbutil/injected-sources-native.test
llvm/test/tools/llvm-pdbutil/injected-sources.test
llvm/tools/llvm-pdbutil/LinePrinter.h
llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64879.210392.patch
Type: text/x-patch
Size: 17566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190717/8a3f4ccb/attachment.bin>
More information about the llvm-commits
mailing list