1 //===-- DWARFContext.h ------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCONTEXT_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCONTEXT_H
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"
19 namespace lldb_private {
22 SectionList *m_main_section_list;
23 SectionList *m_dwo_section_list;
24 mutable std::unique_ptr<llvm::DWARFContext> m_llvm_context;
28 DWARFDataExtractor data;
31 SectionData m_data_debug_abbrev;
32 SectionData m_data_debug_addr;
33 SectionData m_data_debug_aranges;
34 SectionData m_data_debug_cu_index;
35 SectionData m_data_debug_info;
36 SectionData m_data_debug_line;
37 SectionData m_data_debug_line_str;
38 SectionData m_data_debug_loc;
39 SectionData m_data_debug_loclists;
40 SectionData m_data_debug_macro;
41 SectionData m_data_debug_ranges;
42 SectionData m_data_debug_rnglists;
43 SectionData m_data_debug_str;
44 SectionData m_data_debug_str_offsets;
45 SectionData m_data_debug_tu_index;
46 SectionData m_data_debug_types;
48 const DWARFDataExtractor &
49 LoadOrGetSection(llvm::Optional<lldb::SectionType> main_section_type,
50 llvm::Optional<lldb::SectionType> dwo_section_type,
53 const DWARFDataExtractor &getOrLoadCuIndexData();
54 const DWARFDataExtractor &getOrLoadTuIndexData();
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) {}
62 const DWARFDataExtractor &getOrLoadAbbrevData();
63 const DWARFDataExtractor &getOrLoadAddrData();
64 const DWARFDataExtractor &getOrLoadArangesData();
65 const DWARFDataExtractor &getOrLoadDebugInfoData();
66 const DWARFDataExtractor &getOrLoadLineData();
67 const DWARFDataExtractor &getOrLoadLineStrData();
68 const DWARFDataExtractor &getOrLoadLocData();
69 const DWARFDataExtractor &getOrLoadLocListsData();
70 const DWARFDataExtractor &getOrLoadMacroData();
71 const DWARFDataExtractor &getOrLoadRangesData();
72 const DWARFDataExtractor &getOrLoadRngListsData();
73 const DWARFDataExtractor &getOrLoadStrData();
74 const DWARFDataExtractor &getOrLoadStrOffsetsData();
75 const DWARFDataExtractor &getOrLoadDebugTypesData();
77 bool isDwo() { return m_dwo_section_list != nullptr; }
79 llvm::DWARFContext &GetAsLLVM();
81 } // namespace lldb_private