LLDB  mainline
DWARFContext.h
Go to the documentation of this file.
1 //===-- DWARFContext.h ------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCONTEXT_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCONTEXT_H
11 
12 #include "DWARFDataExtractor.h"
13 #include "lldb/Core/Section.h"
14 #include "llvm/ADT/Optional.h"
15 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
16 #include "llvm/Support/Threading.h"
17 #include <memory>
18 
19 namespace lldb_private {
20 class DWARFContext {
21 private:
24  mutable std::unique_ptr<llvm::DWARFContext> m_llvm_context;
25 
26  struct SectionData {
27  llvm::once_flag flag;
29  };
30 
47 
48  const DWARFDataExtractor &
49  LoadOrGetSection(llvm::Optional<lldb::SectionType> main_section_type,
50  llvm::Optional<lldb::SectionType> dwo_section_type,
51  SectionData &data);
52 
55 
56 public:
57  explicit DWARFContext(SectionList *main_section_list,
58  SectionList *dwo_section_list)
59  : m_main_section_list(main_section_list),
60  m_dwo_section_list(dwo_section_list) {}
61 
76 
77  bool isDwo() { return m_dwo_section_list != nullptr; }
78 
79  llvm::DWARFContext &GetAsLLVM();
80 };
81 } // namespace lldb_private
82 
83 #endif
lldb_private::DWARFContext::getOrLoadAbbrevData
const DWARFDataExtractor & getOrLoadAbbrevData()
Definition: DWARFContext.cpp:53
lldb_private::DWARFContext::m_data_debug_line
SectionData m_data_debug_line
Definition: DWARFContext.h:36
lldb_private::DWARFContext::SectionData
Definition: DWARFContext.h:26
lldb_private::DWARFContext::getOrLoadStrData
const DWARFDataExtractor & getOrLoadStrData()
Definition: DWARFContext.cpp:110
lldb_private::DWARFContext::getOrLoadStrOffsetsData
const DWARFDataExtractor & getOrLoadStrOffsetsData()
Definition: DWARFContext.cpp:115
lldb_private::DWARFContext::getOrLoadCuIndexData
const DWARFDataExtractor & getOrLoadCuIndexData()
Definition: DWARFContext.cpp:43
lldb_private::DWARFContext::m_main_section_list
SectionList * m_main_section_list
Definition: DWARFContext.h:22
lldb_private::DWARFContext::getOrLoadAddrData
const DWARFDataExtractor & getOrLoadAddrData()
Definition: DWARFContext.cpp:63
lldb_private::SectionList
Definition: Section.h:34
lldb_private::DWARFDataExtractor
Definition: DWARFDataExtractor.h:18
lldb_private::DWARFContext::m_data_debug_str_offsets
SectionData m_data_debug_str_offsets
Definition: DWARFContext.h:44
Section.h
lldb_private::DWARFContext
Definition: DWARFContext.h:20
lldb_private::DWARFContext::m_data_debug_aranges
SectionData m_data_debug_aranges
Definition: DWARFContext.h:33
lldb_private::DWARFContext::m_data_debug_rnglists
SectionData m_data_debug_rnglists
Definition: DWARFContext.h:42
lldb_private::DWARFContext::GetAsLLVM
llvm::DWARFContext & GetAsLLVM()
Definition: DWARFContext.cpp:126
lldb_private::DWARFContext::m_data_debug_cu_index
SectionData m_data_debug_cu_index
Definition: DWARFContext.h:34
lldb_private::DWARFContext::m_data_debug_abbrev
SectionData m_data_debug_abbrev
Definition: DWARFContext.h:31
lldb_private::DWARFContext::isDwo
bool isDwo()
Definition: DWARFContext.h:77
lldb_private::DWARFContext::getOrLoadLineStrData
const DWARFDataExtractor & getOrLoadLineStrData()
Definition: DWARFContext.cpp:78
lldb_private::DWARFContext::m_data_debug_tu_index
SectionData m_data_debug_tu_index
Definition: DWARFContext.h:45
lldb_private::DWARFContext::getOrLoadDebugInfoData
const DWARFDataExtractor & getOrLoadDebugInfoData()
Definition: DWARFContext.cpp:68
lldb_private::DWARFContext::m_dwo_section_list
SectionList * m_dwo_section_list
Definition: DWARFContext.h:23
lldb_private::DWARFContext::SectionData::flag
llvm::once_flag flag
Definition: DWARFContext.h:27
lldb_private::DWARFContext::m_data_debug_addr
SectionData m_data_debug_addr
Definition: DWARFContext.h:32
lldb_private::DWARFContext::getOrLoadRangesData
const DWARFDataExtractor & getOrLoadRangesData()
Definition: DWARFContext.cpp:99
lldb_private::DWARFContext::m_data_debug_loclists
SectionData m_data_debug_loclists
Definition: DWARFContext.h:39
lldb_private::DWARFContext::DWARFContext
DWARFContext(SectionList *main_section_list, SectionList *dwo_section_list)
Definition: DWARFContext.h:57
lldb_private::DWARFContext::getOrLoadArangesData
const DWARFDataExtractor & getOrLoadArangesData()
Definition: DWARFContext.cpp:58
lldb_private::DWARFContext::m_data_debug_line_str
SectionData m_data_debug_line_str
Definition: DWARFContext.h:37
lldb_private::DWARFContext::SectionData::data
DWARFDataExtractor data
Definition: DWARFContext.h:28
lldb_private::DWARFContext::getOrLoadRngListsData
const DWARFDataExtractor & getOrLoadRngListsData()
Definition: DWARFContext.cpp:104
lldb_private::DWARFContext::m_data_debug_str
SectionData m_data_debug_str
Definition: DWARFContext.h:43
lldb_private::DWARFContext::LoadOrGetSection
const DWARFDataExtractor & LoadOrGetSection(llvm::Optional< lldb::SectionType > main_section_type, llvm::Optional< lldb::SectionType > dwo_section_type, SectionData &data)
Definition: DWARFContext.cpp:31
lldb_private::DWARFContext::getOrLoadMacroData
const DWARFDataExtractor & getOrLoadMacroData()
Definition: DWARFContext.cpp:94
lldb_private::DWARFContext::m_data_debug_loc
SectionData m_data_debug_loc
Definition: DWARFContext.h:38
lldb_private::DWARFContext::m_llvm_context
std::unique_ptr< llvm::DWARFContext > m_llvm_context
Definition: DWARFContext.h:24
lldb_private::DWARFContext::m_data_debug_types
SectionData m_data_debug_types
Definition: DWARFContext.h:46
lldb_private::DWARFContext::m_data_debug_macro
SectionData m_data_debug_macro
Definition: DWARFContext.h:40
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::DWARFContext::getOrLoadLocData
const DWARFDataExtractor & getOrLoadLocData()
Definition: DWARFContext.cpp:83
lldb_private::DWARFContext::getOrLoadDebugTypesData
const DWARFDataExtractor & getOrLoadDebugTypesData()
Definition: DWARFContext.cpp:121
lldb_private::DWARFContext::m_data_debug_info
SectionData m_data_debug_info
Definition: DWARFContext.h:35
lldb_private::DWARFContext::m_data_debug_ranges
SectionData m_data_debug_ranges
Definition: DWARFContext.h:41
lldb_private::DWARFContext::getOrLoadTuIndexData
const DWARFDataExtractor & getOrLoadTuIndexData()
Definition: DWARFContext.cpp:48
lldb_private::DWARFContext::getOrLoadLineData
const DWARFDataExtractor & getOrLoadLineData()
Definition: DWARFContext.cpp:73
lldb_private::DWARFContext::getOrLoadLocListsData
const DWARFDataExtractor & getOrLoadLocListsData()
Definition: DWARFContext.cpp:88
DWARFDataExtractor.h