Path: blob/main/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
39645 views
//===-- DWARFDebugArangeSet.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_DWARFDEBUGARANGESET_H9#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGESET_H1011#include "lldb/Core/dwarf.h"12#include <cstdint>13#include <vector>1415namespace lldb_private::plugin {16namespace dwarf {17class DWARFDebugArangeSet {18public:19struct Header {20/// The total length of the entries for that set, not including the length21/// field itself.22uint32_t length = 0;23/// The DWARF version number.24uint16_t version = 0;25/// The offset from the beginning of the .debug_info section of the26/// compilation unit entry referenced by the table.27uint32_t cu_offset = 0;28/// The size in bytes of an address on the target architecture. For29/// segmented addressing, this is the size of the offset portion of the30/// address.31uint8_t addr_size = 0;32/// The size in bytes of a segment descriptor on the target architecture.33/// If the target system uses a flat address space, this value is 0.34uint8_t seg_size = 0;35};3637struct Descriptor {38dw_addr_t address;39dw_addr_t length;40dw_addr_t end_address() const { return address + length; }41};4243DWARFDebugArangeSet();44void Clear();45void SetOffset(uint32_t offset) { m_offset = offset; }46llvm::Error extract(const DWARFDataExtractor &data,47lldb::offset_t *offset_ptr);48dw_offset_t FindAddress(dw_addr_t address) const;49size_t NumDescriptors() const { return m_arange_descriptors.size(); }50const Header &GetHeader() const { return m_header; }51dw_offset_t GetNextOffset() const { return m_next_offset; }52const Descriptor &GetDescriptorRef(uint32_t i) const {53return m_arange_descriptors[i];54}5556protected:57typedef std::vector<Descriptor> DescriptorColl;58typedef DescriptorColl::iterator DescriptorIter;59typedef DescriptorColl::const_iterator DescriptorConstIter;6061dw_offset_t m_offset;62dw_offset_t m_next_offset;63Header m_header;64DescriptorColl m_arange_descriptors;65};66} // namespace dwarf67} // namespace lldb_private::plugin6869#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGESET_H707172