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"
13 #include "lldb/Utility/RangeMap.h"
14 #include "llvm/Support/Error.h"
15 
17 protected:
20 
21 public:
23  typedef std::vector<RangeToDIE::Entry> RangeColl;
24 
26 
27  void Clear() { m_aranges.Clear(); }
28 
29  void extract(const lldb_private::DWARFDataExtractor &debug_aranges_data);
30 
31  // Use append range multiple times and then call sort
32  void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc);
33 
34  void Sort(bool minimize);
35 
36  void Dump(lldb_private::Log *log) const;
37 
38  dw_offset_t FindAddress(dw_addr_t address) const;
39 
40  bool IsEmpty() const { return m_aranges.IsEmpty(); }
41  size_t GetNumRanges() const { return m_aranges.GetSize(); }
42 
44  const Range *range = m_aranges.GetEntryAtIndex(idx);
45  if (range)
46  return range->data;
47  return DW_INVALID_OFFSET;
48  }
49 
50 protected:
52 };
53 
54 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H
DWARFDebugAranges::RangeColl
std::vector< RangeToDIE::Entry > RangeColl
Definition: DWARFDebugAranges.h:23
DWARFDebugAranges
Definition: DWARFDebugAranges.h:16
DWARFDebugAranges::Sort
void Sort(bool minimize)
Definition: DWARFDebugAranges.cpp:90
DWARFDebugAranges::RangeToDIE
lldb_private::RangeDataVector< dw_addr_t, uint32_t, dw_offset_t > RangeToDIE
Definition: DWARFDebugAranges.h:19
DWARFDebugAranges::OffsetAtIndex
dw_offset_t OffsetAtIndex(uint32_t idx) const
Definition: DWARFDebugAranges.h:43
lldb_private::RangeDataVector::Clear
void Clear()
Definition: RangeMap.h:473
lldb_private::RangeDataVector::GetEntryAtIndex
const Entry * GetEntryAtIndex(size_t i) const
Definition: RangeMap.h:479
DWARFDebugAranges::FindAddress
dw_offset_t FindAddress(dw_addr_t address) const
Definition: DWARFDebugAranges.cpp:99
lldb_private::RangeData
Definition: RangeMap.h:373
lldb_private::DWARFDataExtractor
Definition: DWARFDataExtractor.h:18
RangeMap.h
DW_INVALID_OFFSET
#define DW_INVALID_OFFSET
Definition: dwarf.h:34
DWARFDebugAranges::IsEmpty
bool IsEmpty() const
Definition: DWARFDebugAranges.h:40
DWARFDebugAranges::GetNumRanges
size_t GetNumRanges() const
Definition: DWARFDebugAranges.h:41
DWARFDebugAranges::AppendRange
void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc)
Definition: DWARFDebugAranges.cpp:84
DWARFDebugAranges::Dump
void Dump(lldb_private::Log *log) const
Definition: DWARFDebugAranges.cpp:71
DWARFDebugAranges::Range
RangeToDIE::Entry Range
Definition: DWARFDebugAranges.h:22
DWARFDebugAranges::Clear
void Clear()
Definition: DWARFDebugAranges.h:27
DWARFDebugAranges::m_aranges
RangeToDIE m_aranges
Definition: DWARFDebugAranges.h:51
dwarf.h
uint32_t
lldb_private::RangeDataVector::GetSize
size_t GetSize() const
Definition: RangeMap.h:477
lldb_private::RangeDataVector< dw_addr_t, uint32_t, dw_offset_t >
lldb_private::RangeDataVector::IsEmpty
bool IsEmpty() const
Definition: RangeMap.h:475
DWARFDebugAranges::DWARFDebugAranges
DWARFDebugAranges()
Definition: DWARFDebugAranges.cpp:20
DWARFDebugAranges::extract
void extract(const lldb_private::DWARFDataExtractor &debug_aranges_data)
Definition: DWARFDebugAranges.cpp:35
lldb_private::Log
Definition: Log.h:49
lldb_private::RangeData::data
DataType data
Definition: RangeMap.h:376
dw_addr_t
uint64_t dw_addr_t
Definition: dwarf.h:26