[PATCH] D63713: WIP: DataExtractor error handling

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 06:31:12 PDT 2019


labath created this revision.
labath added reviewers: probinson, dblaikie, JDevlieghere, aprantl, echristo.
Herald added a subscriber: kristina.
Herald added a project: LLVM.

This is motivated by D63591 <https://reviews.llvm.org/D63591>, where we realized that there isn't a really
good way of telling whether a DataExtractor is reading actual data, or
is it just returning default values because it reached the end of the
buffer.

This (WIP) patch tries to solve this issue by providing a kind of a
streaming api on top of the data extractor. It is inspired by the
std::iostreams api, where one can also blindly read from a stream
(receiving default values in case of errors), and then check for any
erros in bulk once the parse has finished.

To achieve this, I introduce a new class (DataStream), which
encapsulates three things:

- the DataExtractor we are reading from
- the current position within that extractor
- an error flag

Please let me know what you think.


Repository:
  rL LLVM

https://reviews.llvm.org/D63713

Files:
  include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
  include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
  include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
  include/llvm/Support/DataExtractor.h
  lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
  lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  lib/DebugInfo/DWARF/DWARFDie.cpp
  test/tools/llvm-dwarfdump/X86/debug-names-verify-short1.s
  test/tools/llvm-dwarfdump/X86/debug-names-verify-short2.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63713.206206.patch
Type: text/x-patch
Size: 23066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190624/138f420b/attachment.bin>


More information about the llvm-commits mailing list