diff options
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp | 65 |
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(); +} |

