summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2020-03-23 14:20:08 +0100
committerPavel Labath <pavel@labath.sk>2020-04-21 16:48:09 +0200
commitcc0acda782858ad8d48a38e024a1987d12249721 (patch)
treeb6b0147f5479d879f8ac166c19e8924de3aba1dc /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
parentc2dd38f1cb7ead1e1b87f5582962fed9a826c02c (diff)
[DWARFDataExtractor] Add a "truncating" constructor
Summary: This constructor allows us to create a new DWARFDataExtractor which will only present a subrange of an entire debug section. Since debug sections typically consist of multiple contributions, it is expected that one will create a new data extractor for each contribution in order to avoid unexpectedly running off into the next one. This is very useful for unifying the flows for detecting parse errors. Without it, the code needs to consider two very different scenarios: 1. If there is another contribution after the current one, the DataExtractor functions will just start reading from there. This is detectable by comparing the current offset against the known end-of-contribution offset. 2. If this is the last contribution, the data extractor will just start returning zeroes (or other default values). This situation can *not* be detected by checking the parsing offset, as this will not be advanced in case of errors. Using a truncated data extractor simplifies the code (and reduces cognitive load) by making these two cases behave identically -- a running off the end of a contribution will _always_ produce an EOF error (if one uses error-aware parsing methods) or return default values. Reviewers: dblaikie, probinson, jhenderson, ikudrin Subscribers: aprantl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77556
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions