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
const DWARFDataExtractor & getOrLoadAbbrevData()
A class that represents a running process on the host machine.
const DWARFDataExtractor & getOrLoadRangesData()
SectionList * m_dwo_section_list
Definition: DWARFContext.h:23
SectionData m_data_debug_types
Definition: DWARFContext.h:46
const DWARFDataExtractor & getOrLoadLineStrData()
const DWARFDataExtractor & getOrLoadTuIndexData()
const DWARFDataExtractor & getOrLoadDebugInfoData()
SectionData m_data_debug_line_str
Definition: DWARFContext.h:37
SectionData m_data_debug_tu_index
Definition: DWARFContext.h:45
SectionData m_data_debug_abbrev
Definition: DWARFContext.h:31
SectionData m_data_debug_macro
Definition: DWARFContext.h:40
const DWARFDataExtractor & getOrLoadLineData()
const DWARFDataExtractor & getOrLoadLocData()
SectionData m_data_debug_loclists
Definition: DWARFContext.h:39
llvm::DWARFContext & GetAsLLVM()
const DWARFDataExtractor & getOrLoadLocListsData()
SectionList * m_main_section_list
Definition: DWARFContext.h:22
std::unique_ptr< llvm::DWARFContext > m_llvm_context
Definition: DWARFContext.h:24
const DWARFDataExtractor & getOrLoadAddrData()
const DWARFDataExtractor & getOrLoadStrOffsetsData()
SectionData m_data_debug_cu_index
Definition: DWARFContext.h:34
const DWARFDataExtractor & getOrLoadCuIndexData()
DWARFContext(SectionList *main_section_list, SectionList *dwo_section_list)
Definition: DWARFContext.h:57
const DWARFDataExtractor & getOrLoadArangesData()
const DWARFDataExtractor & getOrLoadDebugTypesData()
const DWARFDataExtractor & getOrLoadStrData()
const DWARFDataExtractor & LoadOrGetSection(llvm::Optional< lldb::SectionType > main_section_type, llvm::Optional< lldb::SectionType > dwo_section_type, SectionData &data)
SectionData m_data_debug_str_offsets
Definition: DWARFContext.h:44
SectionData m_data_debug_aranges
Definition: DWARFContext.h:33
const DWARFDataExtractor & getOrLoadMacroData()
SectionData m_data_debug_rnglists
Definition: DWARFContext.h:42
const DWARFDataExtractor & getOrLoadRngListsData()
SectionData m_data_debug_ranges
Definition: DWARFContext.h:41