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/DebugInfo/DWARF/DWARFContext.h"
15#include "llvm/Support/Threading.h"
16#include <memory>
17#include <optional>
18
19namespace lldb_private {
21private:
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(std::optional<lldb::SectionType> main_section_type,
50 std::optional<lldb::SectionType> dwo_section_type,
51 SectionData &data);
52
55
56public:
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 & getOrLoadLineData()
const DWARFDataExtractor & getOrLoadTuIndexData()
std::unique_ptr< llvm::DWARFContext > m_llvm_context
Definition: DWARFContext.h:24
SectionData m_data_debug_rnglists
Definition: DWARFContext.h:42
SectionData m_data_debug_cu_index
Definition: DWARFContext.h:34
const DWARFDataExtractor & getOrLoadLocListsData()
SectionData m_data_debug_str_offsets
Definition: DWARFContext.h:44
const DWARFDataExtractor & getOrLoadStrOffsetsData()
const DWARFDataExtractor & getOrLoadCuIndexData()
const DWARFDataExtractor & getOrLoadStrData()
llvm::DWARFContext & GetAsLLVM()
SectionList * m_dwo_section_list
Definition: DWARFContext.h:23
SectionData m_data_debug_abbrev
Definition: DWARFContext.h:31
const DWARFDataExtractor & LoadOrGetSection(std::optional< lldb::SectionType > main_section_type, std::optional< lldb::SectionType > dwo_section_type, SectionData &data)
const DWARFDataExtractor & getOrLoadArangesData()
DWARFContext(SectionList *main_section_list, SectionList *dwo_section_list)
Definition: DWARFContext.h:57
SectionData m_data_debug_tu_index
Definition: DWARFContext.h:45
const DWARFDataExtractor & getOrLoadDebugTypesData()
const DWARFDataExtractor & getOrLoadDebugInfoData()
const DWARFDataExtractor & getOrLoadRangesData()
SectionData m_data_debug_line_str
Definition: DWARFContext.h:37
const DWARFDataExtractor & getOrLoadRngListsData()
const DWARFDataExtractor & getOrLoadAbbrevData()
SectionList * m_main_section_list
Definition: DWARFContext.h:22
const DWARFDataExtractor & getOrLoadMacroData()
SectionData m_data_debug_ranges
Definition: DWARFContext.h:41
const DWARFDataExtractor & getOrLoadLocData()
SectionData m_data_debug_types
Definition: DWARFContext.h:46
SectionData m_data_debug_loclists
Definition: DWARFContext.h:39
const DWARFDataExtractor & getOrLoadLineStrData()
SectionData m_data_debug_aranges
Definition: DWARFContext.h:33
const DWARFDataExtractor & getOrLoadAddrData()
SectionData m_data_debug_macro
Definition: DWARFContext.h:40
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14