LLDB  mainline
NameToDIE.h
Go to the documentation of this file.
1 //===-- NameToDIE.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_NAMETODIE_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_NAMETODIE_H
11 
12 #include <functional>
13 
14 #include "DIERef.h"
16 #include "lldb/Core/dwarf.h"
17 #include "lldb/lldb-defines.h"
18 
19 class DWARFUnit;
20 
21 class NameToDIE {
22 public:
23  NameToDIE() : m_map() {}
24 
25  ~NameToDIE() = default;
26 
27  void Dump(lldb_private::Stream *s);
28 
29  void Insert(lldb_private::ConstString name, const DIERef &die_ref);
30 
31  void Append(const NameToDIE &other);
32 
33  void Finalize();
34 
36  llvm::function_ref<bool(DIERef ref)> callback) const;
37 
38  bool Find(const lldb_private::RegularExpression &regex,
39  llvm::function_ref<bool(DIERef ref)> callback) const;
40 
41  /// \a unit must be the skeleton unit if possible, not GetNonSkeletonUnit().
42  void
44  llvm::function_ref<bool(DIERef ref)> callback) const;
45 
46  void
47  ForEach(std::function<bool(lldb_private::ConstString name,
48  const DIERef &die_ref)> const
49  &callback) const;
50 
51 protected:
53 };
54 
55 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_NAMETODIE_H
DIERef
Identifies a DWARF debug info entry within a given Module.
Definition: DIERef.h:26
DIERef.h
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb-defines.h
lldb_private::Stream
Definition: Stream.h:28
UniqueCStringMap.h
DWARFUnit
Definition: DWARFUnit.h:80
lldb_private::ConstString
Definition: ConstString.h:40
NameToDIE::~NameToDIE
~NameToDIE()=default
NameToDIE::NameToDIE
NameToDIE()
Definition: NameToDIE.h:23
NameToDIE::FindAllEntriesForUnit
void FindAllEntriesForUnit(DWARFUnit &unit, llvm::function_ref< bool(DIERef ref)> callback) const
unit must be the skeleton unit if possible, not GetNonSkeletonUnit().
Definition: NameToDIE.cpp:47
NameToDIE::Insert
void Insert(lldb_private::ConstString name, const DIERef &die_ref)
Definition: NameToDIE.cpp:25
lldb_private::UniqueCStringMap< DIERef >
NameToDIE::Find
bool Find(lldb_private::ConstString name, llvm::function_ref< bool(DIERef ref)> callback) const
Definition: NameToDIE.cpp:29
dwarf.h
NameToDIE::Append
void Append(const NameToDIE &other)
Definition: NameToDIE.cpp:83
NameToDIE::m_map
lldb_private::UniqueCStringMap< DIERef > m_map
Definition: NameToDIE.h:52
NameToDIE::Dump
void Dump(lldb_private::Stream *s)
Definition: NameToDIE.cpp:64
NameToDIE::Finalize
void Finalize()
Definition: NameToDIE.cpp:20
NameToDIE
Definition: NameToDIE.h:21
NameToDIE::ForEach
void ForEach(std::function< bool(lldb_private::ConstString name, const DIERef &die_ref)> const &callback) const
Definition: NameToDIE.cpp:72