Files
clang-p2996/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
Jan Kratochvil f3932b9a0b [nfc] [lldb] Assertions for D106270 - [DWARF5] Fix offset check when using .debug_names
Skeleton vs. DWO units mismatch has been fixed in D106270. As they both
have type DWARFUnit it is a bit difficult to debug. So it is better to
make it safe against future changes.

Reviewed By: kimanh, clayborg

Differential Revision: https://reviews.llvm.org/D107659
2021-08-10 20:43:24 +02:00

56 lines
1.6 KiB
C++

//===-- NameToDIE.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_NAMETODIE_H
#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_NAMETODIE_H
#include <functional>
#include "DIERef.h"
#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/Core/dwarf.h"
#include "lldb/lldb-defines.h"
class DWARFUnit;
class NameToDIE {
public:
NameToDIE() : m_map() {}
~NameToDIE() = default;
void Dump(lldb_private::Stream *s);
void Insert(lldb_private::ConstString name, const DIERef &die_ref);
void Append(const NameToDIE &other);
void Finalize();
bool Find(lldb_private::ConstString name,
llvm::function_ref<bool(DIERef ref)> callback) const;
bool Find(const lldb_private::RegularExpression &regex,
llvm::function_ref<bool(DIERef ref)> callback) const;
/// \a unit must be the skeleton unit if possible, not GetNonSkeletonUnit().
void
FindAllEntriesForUnit(DWARFUnit &unit,
llvm::function_ref<bool(DIERef ref)> callback) const;
void
ForEach(std::function<bool(lldb_private::ConstString name,
const DIERef &die_ref)> const
&callback) const;
protected:
lldb_private::UniqueCStringMap<DIERef> m_map;
};
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_NAMETODIE_H