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 {
21 uint32_t length; // The total length of the entries for that set, not
22 // including the length field itself.
23 uint16_t version; // The DWARF version number
24 uint32_t cu_offset; // The offset from the beginning of the .debug_info
25 // section of the compilation unit entry referenced by
27 uint8_t addr_size; // The size in bytes of an address on the target
28 // architecture. For segmented addressing, this is the
29 // size of the offset portion of the address
30 uint8_t seg_size; // The size in bytes of a segment descriptor on the target
31 // architecture. If the target system uses a flat address
32 // space, this value is 0.
38 dw_addr_t end_address() const { return address + length; }
41 DWARFDebugArangeSet();
43 void SetOffset(uint32_t offset) { m_offset = offset; }
44 void SetHeader(uint16_t version, uint32_t cu_offset, uint8_t addr_size,
46 void AddDescriptor(const DWARFDebugArangeSet::Descriptor &range);
48 bool Extract(const lldb_private::DWARFDataExtractor &data,
49 lldb::offset_t *offset_ptr);
50 void Dump(lldb_private::Stream *s) const;
51 dw_offset_t GetCompileUnitDIEOffset() const { return m_header.cu_offset; }
52 dw_offset_t GetOffsetOfNextEntry() const;
53 dw_offset_t FindAddress(dw_addr_t address) const;
54 size_t NumDescriptors() const { return m_arange_descriptors.size(); }
55 const Header &GetHeader() const { return m_header; }
56 const Descriptor *GetDescriptor(uint32_t i) const {
57 if (i < m_arange_descriptors.size())
58 return &m_arange_descriptors[i];
62 const Descriptor &GetDescriptorRef(uint32_t i) const {
63 return m_arange_descriptors[i];
67 typedef std::vector<Descriptor> DescriptorColl;
68 typedef DescriptorColl::iterator DescriptorIter;
69 typedef DescriptorColl::const_iterator DescriptorConstIter;
73 DescriptorColl m_arange_descriptors;
76 #endif // SymbolFileDWARF_DWARFDebugArangeSet_h_