Path: blob/main/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
39645 views
//===-- DWARFContext.h ------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCONTEXT_H9#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCONTEXT_H1011#include "DWARFDataExtractor.h"12#include "lldb/Core/Section.h"13#include "llvm/DebugInfo/DWARF/DWARFContext.h"14#include "llvm/Support/Threading.h"15#include <memory>16#include <optional>1718namespace lldb_private::plugin {19namespace dwarf {20class DWARFContext {21private:22SectionList *m_main_section_list;23SectionList *m_dwo_section_list;24mutable std::unique_ptr<llvm::DWARFContext> m_llvm_context;2526struct SectionData {27llvm::once_flag flag;28DWARFDataExtractor data;29};3031SectionData m_data_debug_abbrev;32SectionData m_data_debug_addr;33SectionData m_data_debug_aranges;34SectionData m_data_debug_cu_index;35SectionData m_data_debug_info;36SectionData m_data_debug_line;37SectionData m_data_debug_line_str;38SectionData m_data_debug_loc;39SectionData m_data_debug_loclists;40SectionData m_data_debug_macro;41SectionData m_data_debug_ranges;42SectionData m_data_debug_rnglists;43SectionData m_data_debug_str;44SectionData m_data_debug_str_offsets;45SectionData m_data_debug_tu_index;46SectionData m_data_debug_types;4748const DWARFDataExtractor &49LoadOrGetSection(std::optional<lldb::SectionType> main_section_type,50std::optional<lldb::SectionType> dwo_section_type,51SectionData &data);5253const DWARFDataExtractor &getOrLoadCuIndexData();54const DWARFDataExtractor &getOrLoadTuIndexData();5556public:57explicit DWARFContext(SectionList *main_section_list,58SectionList *dwo_section_list)59: m_main_section_list(main_section_list),60m_dwo_section_list(dwo_section_list) {}6162const DWARFDataExtractor &getOrLoadAbbrevData();63const DWARFDataExtractor &getOrLoadAddrData();64const DWARFDataExtractor &getOrLoadArangesData();65const DWARFDataExtractor &getOrLoadDebugInfoData();66const DWARFDataExtractor &getOrLoadLineData();67const DWARFDataExtractor &getOrLoadLineStrData();68const DWARFDataExtractor &getOrLoadLocData();69const DWARFDataExtractor &getOrLoadLocListsData();70const DWARFDataExtractor &getOrLoadMacroData();71const DWARFDataExtractor &getOrLoadRangesData();72const DWARFDataExtractor &getOrLoadRngListsData();73const DWARFDataExtractor &getOrLoadStrData();74const DWARFDataExtractor &getOrLoadStrOffsetsData();75const DWARFDataExtractor &getOrLoadDebugTypesData();7677bool isDwo() { return m_dwo_section_list != nullptr; }7879llvm::DWARFContext &GetAsLLVM();80};81} // namespace dwarf82} // namespace lldb_private::plugin8384#endif858687