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