Path: blob/main/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
39645 views
//===-- DWARFDebugAranges.h -------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H9#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H1011#include "lldb/Core/dwarf.h"12#include "lldb/Utility/RangeMap.h"13#include "llvm/Support/Error.h"1415namespace lldb_private::plugin {16namespace dwarf {17class DWARFDebugAranges {18protected:19typedef RangeDataVector<dw_addr_t, uint32_t, dw_offset_t> RangeToDIE;2021public:22typedef RangeToDIE::Entry Range;23typedef std::vector<RangeToDIE::Entry> RangeColl;2425DWARFDebugAranges();2627void Clear() { m_aranges.Clear(); }2829void extract(const DWARFDataExtractor &debug_aranges_data);3031// Use append range multiple times and then call sort32void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc);3334void Sort(bool minimize);3536void Dump(Log *log) const;3738dw_offset_t FindAddress(dw_addr_t address) const;3940bool IsEmpty() const { return m_aranges.IsEmpty(); }41size_t GetNumRanges() const { return m_aranges.GetSize(); }4243dw_offset_t OffsetAtIndex(uint32_t idx) const {44const Range *range = m_aranges.GetEntryAtIndex(idx);45if (range)46return range->data;47return DW_INVALID_OFFSET;48}4950protected:51RangeToDIE m_aranges;52};53} // namespace dwarf54} // namespace lldb_private::plugin5556#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H575859