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 SymbolFileDWARF_DWARFDebugAranges_h_
10 #define SymbolFileDWARF_DWARFDebugAranges_h_
11 
12 #include "DWARFDebugArangeSet.h"
13 #include "lldb/Utility/RangeMap.h"
14 #include "llvm/Support/Error.h"
15 #include <list>
16 
17 class SymbolFileDWARF;
18 
20 protected:
23 
24 public:
26  typedef std::vector<RangeToDIE::Entry> RangeColl;
27 
29 
30  void Clear() { m_aranges.Clear(); }
31 
33  extract(const lldb_private::DWARFDataExtractor &debug_aranges_data);
34 
35  // Use append range multiple times and then call sort
36  void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc);
37 
38  void Sort(bool minimize);
39 
40  void Dump(lldb_private::Log *log) const;
41 
42  dw_offset_t FindAddress(dw_addr_t address) const;
43 
44  bool IsEmpty() const { return m_aranges.IsEmpty(); }
45  size_t GetNumRanges() const { return m_aranges.GetSize(); }
46 
48  const Range *range = m_aranges.GetEntryAtIndex(idx);
49  if (range)
50  return range->data;
51  return DW_INVALID_OFFSET;
52  }
53 
54 protected:
56 };
57 
58 #endif // SymbolFileDWARF_DWARFDebugAranges_h_
const Entry * GetEntryAtIndex(size_t i) const
Definition: RangeMap.h:698
dw_offset_t FindAddress(dw_addr_t address) const
llvm::Error Error
std::vector< RangeToDIE::Entry > RangeColl
uint64_t dw_addr_t
Definition: dwarf.h:26
void Sort(bool minimize)
size_t GetNumRanges() const
lldb_private::RangeDataVector< dw_addr_t, uint32_t, dw_offset_t > RangeToDIE
dw_offset_t OffsetAtIndex(uint32_t idx) const
bool IsEmpty() const
void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc)
void Dump(lldb_private::Log *log) const
llvm::Error extract(const lldb_private::DWARFDataExtractor &debug_aranges_data)
RangeToDIE::Entry Range
#define DW_INVALID_OFFSET
Definition: dwarf.h:34