summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-03-21 16:34:58 +0000
committerZachary Turner <zturner@google.com>2019-03-21 16:34:58 +0000
commitb4fe87d0c9b119f603b4de3154bccafcc9f15285 (patch)
tree4c4f4df5ac76b77e0e435ab40599c815629d3b25 /lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
parent952387251e7e11d65336ab31433114f6db50a21b (diff)
downloadbcm5719-llvm-b4fe87d0c9b119f603b4de3154bccafcc9f15285.tar.gz
bcm5719-llvm-b4fe87d0c9b119f603b4de3154bccafcc9f15285.zip
Move the rest of the sections over to DWARFContext.
This is mostly mechanical, and just moves the remaining non-DWO related sections over to DWARFContext. Differential Revision: https://reviews.llvm.org/D59611 llvm-svn: 356682
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
index d8a44ccacb9..1fbe817dfd2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
@@ -14,6 +14,13 @@ using namespace lldb;
using namespace lldb_private;
static const DWARFDataExtractor *
+GetPointerOrNull(const llvm::Optional<DWARFDataExtractor> &extractor) {
+ if (!extractor.hasValue())
+ return nullptr;
+ return extractor.getPointer();
+}
+
+static const DWARFDataExtractor *
LoadOrGetSection(Module &module, SectionType section_type,
llvm::Optional<DWARFDataExtractor> &extractor) {
if (extractor.hasValue())
@@ -41,3 +48,61 @@ const DWARFDataExtractor *DWARFContext::getOrLoadArangesData() {
return LoadOrGetSection(m_module, eSectionTypeDWARFDebugAranges,
m_data_debug_aranges);
}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugLineData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugLine,
+ m_data_debug_line);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugLineStrData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugLineStr,
+ m_data_debug_line_str);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugMacroData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugMacro,
+ m_data_debug_macro);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugLocData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugLoc,
+ m_data_debug_loc);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugLoclistData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugLocLists,
+ m_data_debug_loclists);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugRangesData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugRanges,
+ m_data_debug_ranges);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugRnglistsData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugRngLists,
+ m_data_debug_rnglists);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugFrameData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugFrame,
+ m_data_debug_frame);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadDebugTypesData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFDebugTypes,
+ m_data_debug_types);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadGnuDebugAltlinkData() {
+ return LoadOrGetSection(m_module, eSectionTypeDWARFGNUDebugAltLink,
+ m_data_gnu_debug_altlink);
+}
+
+const DWARFDataExtractor *DWARFContext::getOrLoadBestDebugLocData() {
+ const DWARFDataExtractor *loc = getOrLoadDebugLocData();
+ if (loc)
+ return loc;
+
+ return getOrLoadDebugLoclistData();
+}
OpenPOWER on IntegriCloud