LLDB mainline
DWARFDebugAranges.h
Go to the documentation of this file.
1//===-- DWARFDebugAranges.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_DWARFDEBUGARANGES_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H
11
12#include "lldb/Core/dwarf.h"
14#include "llvm/Support/Error.h"
15
16namespace lldb_private::plugin {
17namespace dwarf {
19protected:
21
22public:
24 typedef std::vector<RangeToDIE::Entry> RangeColl;
25
27
28 void Clear() { m_aranges.Clear(); }
29
30 void extract(const DWARFDataExtractor &debug_aranges_data);
31
32 // Use append range multiple times and then call sort
33 void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc);
34
35 void Sort(bool minimize);
36
37 void Dump(Log *log) const;
38
39 dw_offset_t FindAddress(dw_addr_t address) const;
40
41 bool IsEmpty() const { return m_aranges.IsEmpty(); }
42 size_t GetNumRanges() const { return m_aranges.GetSize(); }
43
44 dw_offset_t OffsetAtIndex(uint32_t idx) const {
45 const Range *range = m_aranges.GetEntryAtIndex(idx);
46 if (range)
47 return range->data;
48 return DW_INVALID_OFFSET;
49 }
50
51protected:
53};
54} // namespace dwarf
55} // namespace lldb_private::plugin
56
57#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H
const Entry * GetEntryAtIndex(size_t i) const
Definition: RangeMap.h:528
void extract(const DWARFDataExtractor &debug_aranges_data)
std::vector< RangeToDIE::Entry > RangeColl
dw_offset_t OffsetAtIndex(uint32_t idx) const
dw_offset_t FindAddress(dw_addr_t address) const
void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc)
RangeDataVector< dw_addr_t, uint32_t, dw_offset_t > RangeToDIE
uint64_t dw_offset_t
Definition: dwarf.h:31
#define DW_INVALID_OFFSET
Definition: dwarf.h:36
uint64_t dw_addr_t
Definition: dwarf.h:27