LLDB  mainline
DWARFDebugArangeSet.h
Go to the documentation of this file.
1 //===-- DWARFDebugArangeSet.h -----------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef SymbolFileDWARF_DWARFDebugArangeSet_h_
10 #define SymbolFileDWARF_DWARFDebugArangeSet_h_
11 
12 #include "SymbolFileDWARF.h"
13 #include <vector>
14 
15 class SymbolFileDWARF;
16 
18 public:
19  struct Header {
20  uint32_t length; // The total length of the entries for that set, not
21  // including the length field itself.
22  uint16_t version; // The DWARF version number
23  uint32_t cu_offset; // The offset from the beginning of the .debug_info
24  // section of the compilation unit entry referenced by
25  // the table.
26  uint8_t addr_size; // The size in bytes of an address on the target
27  // architecture. For segmented addressing, this is the
28  // size of the offset portion of the address
29  uint8_t seg_size; // The size in bytes of a segment descriptor on the target
30  // architecture. If the target system uses a flat address
31  // space, this value is 0.
32  };
33 
34  struct Descriptor {
37  dw_addr_t end_address() const { return address + length; }
38  };
39 
41  void Clear();
42  void SetOffset(uint32_t offset) { m_offset = offset; }
44  lldb::offset_t *offset_ptr);
45  dw_offset_t FindAddress(dw_addr_t address) const;
46  size_t NumDescriptors() const { return m_arange_descriptors.size(); }
47  const Header &GetHeader() const { return m_header; }
48 
50  return m_arange_descriptors[i];
51  }
52 
53 protected:
54  typedef std::vector<Descriptor> DescriptorColl;
55  typedef DescriptorColl::iterator DescriptorIter;
56  typedef DescriptorColl::const_iterator DescriptorConstIter;
57 
60  DescriptorColl m_arange_descriptors;
61 };
62 
63 #endif // SymbolFileDWARF_DWARFDebugArangeSet_h_
void SetOffset(uint32_t offset)
dw_offset_t FindAddress(dw_addr_t address) const
DescriptorColl::iterator DescriptorIter
llvm::Error Error
size_t NumDescriptors() const
uint64_t dw_addr_t
Definition: dwarf.h:26
const Descriptor & GetDescriptorRef(uint32_t i) const
uint64_t offset_t
Definition: lldb-types.h:87
const Header & GetHeader() const
llvm::Error extract(const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
DescriptorColl m_arange_descriptors
DescriptorColl::const_iterator DescriptorConstIter
std::vector< Descriptor > DescriptorColl