1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/DebugInfo/DWARF
Pavel Labath d0775d3cfb Add error handling to the DataExtractor class
Summary:
This is motivated by 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 patch resolves that by providing a new "Cursor" class. A Cursor
object encapsulates two things:
- the current position/offset in the DataExtractor
- an error object

Storing the error object inside the Cursor enables one to use the same
pattern as the std::{io}stream API, where one can blindly perform a
sequence of reads and only check for errors once at the end of the
operation. Similarly to the stream API, as soon as we encounter one
error, all of the subsequent operations are skipped (return default
values) too, even if the would suceed with clear error state. Unlike the
std::stream API (but in line with other llvm APIs), we force the error
state to be checked through usage of llvm::Error.

Reviewers: probinson, dblaikie, JDevlieghere, aprantl, echristo

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63713

llvm-svn: 370042
2019-08-27 11:24:08 +00:00
..
CMakeLists.txt [DWARF] Revert r345546: Refactor range list extraction and dumping 2018-10-31 01:12:58 +00:00
DWARFAbbreviationDeclaration.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFAcceleratorTable.cpp Remove support for 32-bit offsets in utility classes (5/5) 2019-08-07 11:44:47 +00:00
DWARFAddressRange.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DWARFCompileUnit.cpp [DWARF] Adjust return type of DWARFUnit::getLength(). 2019-08-21 14:10:57 +00:00
DWARFContext.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
DWARFDataExtractor.cpp Add error handling to the DataExtractor class 2019-08-27 11:24:08 +00:00
DWARFDebugAbbrev.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugAddr.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugAranges.cpp DebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names 2019-08-07 17:18:11 +00:00
DWARFDebugArangeSet.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugFrame.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
DWARFDebugInfoEntry.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugLine.cpp [DebugLine] Don't try to guess the path style 2019-08-15 23:53:15 +00:00
DWARFDebugLoc.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugMacro.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugPubTable.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugRangeList.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDebugRnglists.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFDie.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFExpression.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFFormValue.cpp Remove support for 32-bit offsets in utility classes (5/5) 2019-08-07 11:44:47 +00:00
DWARFGdbIndex.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFListTable.cpp Switch LLVM to use 64-bit offsets (2/5) 2019-08-06 10:49:40 +00:00
DWARFTypeUnit.cpp [DWARF] Adjust return type of DWARFUnit::getLength(). 2019-08-21 14:10:57 +00:00
DWARFUnit.cpp [DWARF] Fix reading 64-bit DWARF type units. 2019-08-20 12:52:32 +00:00
DWARFUnitIndex.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
DWARFVerifier.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00