1 //===-- DWARFDebugArangeSet.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef SymbolFileDWARF_DWARFDebugArangeSet_h_
11 #define SymbolFileDWARF_DWARFDebugArangeSet_h_
13 #include "SymbolFileDWARF.h"
16 class SymbolFileDWARF;
18 class DWARFDebugArangeSet
23 uint32_t length; // The total length of the entries for that set, not including the length field itself.
24 uint16_t version; // The DWARF version number
25 uint32_t cu_offset; // The offset from the beginning of the .debug_info section of the compilation unit entry referenced by the table.
26 uint8_t addr_size; // The size in bytes of an address on the target architecture. For segmented addressing, this is the size of the offset portion of the address
27 uint8_t seg_size; // The size in bytes of a segment descriptor on the target architecture. If the target system uses a flat address space, this value is 0.
34 dw_addr_t end_address() const { return address + length; }
38 DWARFDebugArangeSet();
40 void SetOffset(uint32_t offset) { m_offset = offset; }
41 void SetHeader(uint16_t version, uint32_t cu_offset, uint8_t addr_size, uint8_t seg_size);
42 void AddDescriptor(const DWARFDebugArangeSet::Descriptor& range);
44 bool Extract(const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr);
45 void Dump(lldb_private::Stream *s) const;
46 dw_offset_t GetCompileUnitDIEOffset() const { return m_header.cu_offset; }
47 dw_offset_t GetOffsetOfNextEntry() const;
48 dw_offset_t FindAddress(dw_addr_t address) const;
49 size_t NumDescriptors() const { return m_arange_descriptors.size(); }
50 const Header& GetHeader() const { return m_header; }
51 const Descriptor* GetDescriptor(uint32_t i) const
53 if (i < m_arange_descriptors.size())
54 return &m_arange_descriptors[i];
59 GetDescriptorRef (uint32_t i) const
61 return m_arange_descriptors[i];
66 typedef std::vector<Descriptor> DescriptorColl;
67 typedef DescriptorColl::iterator DescriptorIter;
68 typedef DescriptorColl::const_iterator DescriptorConstIter;
73 DescriptorColl m_arange_descriptors;
76 #endif // SymbolFileDWARF_DWARFDebugArangeSet_h_