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