OSDN Git Service

[llvm-pdbutil] Add a function for formatting MSF data.
authorZachary Turner <zturner@google.com>
Fri, 23 Jun 2017 18:52:13 +0000 (18:52 +0000)
committerZachary Turner <zturner@google.com>
Fri, 23 Jun 2017 18:52:13 +0000 (18:52 +0000)
commit35abb61d54913f2df2c3c38361ff4c945e61d4d3
treefe03577284ecbcb0097912457aa4192a5e298b25
parent5c1e1168dc2efcc7f9556a4e460bfab3dd6852a3
[llvm-pdbutil] Add a function for formatting MSF data.

The goal here is to make it possible to display absolute
file offsets when dumping byets from an MSF.  The problem is
that when dumping bytes from an MSF, often the bytes will
cross a block boundary and encounter a discontinuity.  We
can't use the normal formatBinary() function for this because
this would just treat the sequence as entirely ascending, and
not account out-of-order blocks.

This patch adds a formatMsfData() function to our printer, and
then uses this function to improve the output of the -stream-data
command line option for dumping bytes from a particular stream.

Test coverage is also expanded to make sure to include all possible
scenarios of offsets, sizes, and crossing block boundaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306141 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/PDB/Native/PDBFile.h
lib/DebugInfo/PDB/Native/PDBFile.cpp
test/DebugInfo/PDB/pdbdump-raw-stream.test
tools/llvm-pdbutil/BytesOutputStyle.cpp
tools/llvm-pdbutil/LinePrinter.cpp
tools/llvm-pdbutil/LinePrinter.h