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::plugin {
20namespace dwarf {
22private:
25 mutable std::unique_ptr<llvm::DWARFContext> m_llvm_context;
26
27 struct SectionData {
28 llvm::once_flag flag;
30 };
31
48
49 const DWARFDataExtractor &
50 LoadOrGetSection(std::optional<lldb::SectionType> main_section_type,
51 std::optional<lldb::SectionType> dwo_section_type,
52 SectionData &data);
53
56
57public:
58 explicit DWARFContext(SectionList *main_section_list,
59 SectionList *dwo_section_list)
60 : m_main_section_list(main_section_list),
61 m_dwo_section_list(dwo_section_list) {}
62
77
78 bool isDwo() { return m_dwo_section_list != nullptr; }
79
80 llvm::DWARFContext &GetAsLLVM();
81};
82} // namespace dwarf
83} // namespace lldb_private::plugin
84
85#endif
const DWARFDataExtractor & getOrLoadLineData()
const DWARFDataExtractor & getOrLoadTuIndexData()
const DWARFDataExtractor & getOrLoadLocListsData()
const DWARFDataExtractor & getOrLoadStrOffsetsData()
const DWARFDataExtractor & getOrLoadCuIndexData()
std::unique_ptr< llvm::DWARFContext > m_llvm_context
Definition: DWARFContext.h:25
const DWARFDataExtractor & getOrLoadStrData()
DWARFContext(SectionList *main_section_list, SectionList *dwo_section_list)
Definition: DWARFContext.h:58
const DWARFDataExtractor & LoadOrGetSection(std::optional< lldb::SectionType > main_section_type, std::optional< lldb::SectionType > dwo_section_type, SectionData &data)
const DWARFDataExtractor & getOrLoadArangesData()
const DWARFDataExtractor & getOrLoadDebugTypesData()
const DWARFDataExtractor & getOrLoadDebugInfoData()
const DWARFDataExtractor & getOrLoadRangesData()
const DWARFDataExtractor & getOrLoadRngListsData()
const DWARFDataExtractor & getOrLoadAbbrevData()
const DWARFDataExtractor & getOrLoadMacroData()
const DWARFDataExtractor & getOrLoadLocData()
const DWARFDataExtractor & getOrLoadLineStrData()
const DWARFDataExtractor & getOrLoadAddrData()