Coverage Report

Created: 2022-01-25 06:29

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
Line
Count
Source (jump to first uncovered line)
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
16
class DWARFDebugAranges {
17
protected:
18
  typedef lldb_private::RangeDataVector<dw_addr_t, uint32_t, dw_offset_t>
19
      RangeToDIE;
20
21
public:
22
  typedef RangeToDIE::Entry Range;
23
  typedef std::vector<RangeToDIE::Entry> RangeColl;
24
25
  DWARFDebugAranges();
26
27
0
  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
58.5k
  bool IsEmpty() const { return m_aranges.IsEmpty(); }
41
37.0k
  size_t GetNumRanges() const { return m_aranges.GetSize(); }
42
43
30.0k
  dw_offset_t OffsetAtIndex(uint32_t idx) const {
44
30.0k
    const Range *range = m_aranges.GetEntryAtIndex(idx);
45
30.0k
    if (range)
46
30.0k
      return range->data;
47
0
    return DW_INVALID_OFFSET;
48
30.0k
  }
49
50
protected:
51
  RangeToDIE m_aranges;
52
};
53
54
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H