diff options
author | Zachary Turner <zturner@google.com> | 2016-09-09 19:00:49 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-09 19:00:49 +0000 |
commit | 36efbfa6d81b3d15144bb2d5683f654a6b4246d4 (patch) | |
tree | 6c250f111c6d63136bc7b2983479523bcb5f1d77 /llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp | |
parent | c236e5a0f1b9b8118428bec5a7adf3e3efc86cf1 (diff) | |
download | bcm5719-llvm-36efbfa6d81b3d15144bb2d5683f654a6b4246d4.tar.gz bcm5719-llvm-36efbfa6d81b3d15144bb2d5683f654a6b4246d4.zip |
[pdb] Print out some more info when dumping a raw stream.
We have various command line options that print the type of a
stream, the size of a stream, etc but nowhere that it can all be
viewed together.
Since a previous patch introduced the ability to dump the bytes
of a stream, this seems like a good place to present a full view
of the stream's properties including its size, what kind of data
it represents, and the blocks it occupies. So I added the
ability to print that information to the -stream-data command
line option.
llvm-svn: 281077
Diffstat (limited to 'llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp index bbcfbfca810..403c02b4268 100644 --- a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp +++ b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp @@ -200,6 +200,10 @@ uint32_t MappedBlockStream::getLength() const { return StreamLayout.Length; } bool MappedBlockStream::tryReadContiguously(uint32_t Offset, uint32_t Size, ArrayRef<uint8_t> &Buffer) const { + if (Size == 0) { + Buffer = ArrayRef<uint8_t>(); + return true; + } // Attempt to fulfill the request with a reference directly into the stream. // This can work even if the request crosses a block boundary, provided that // all subsequent blocks are contiguous. For example, a 10k read with a 4k |