]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/AddressResolverName.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / AddressResolverName.h
1 //===-- AddressResolverName.h -----------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_AddressResolverName_h_
11 #define liblldb_AddressResolverName_h_
12
13 #include "lldb/Core/AddressResolver.h"
14 #include "lldb/Core/SearchFilter.h"   // for Searcher, Searcher::Call...
15 #include "lldb/Utility/ConstString.h" // for ConstString
16 #include "lldb/Utility/RegularExpression.h"
17 #include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
18
19 namespace lldb_private {
20 class Address;
21 }
22 namespace lldb_private {
23 class Stream;
24 }
25 namespace lldb_private {
26 class SymbolContext;
27 }
28
29 namespace lldb_private {
30
31 //----------------------------------------------------------------------
32 /// @class AddressResolverName AddressResolverName.h
33 /// "lldb/Core/AddressResolverName.h"
34 /// @brief This class finds addresses for a given function name, either by exact
35 /// match
36 /// or by regular expression.
37 //----------------------------------------------------------------------
38
39 class AddressResolverName : public AddressResolver {
40 public:
41   AddressResolverName(const char *func_name,
42                       AddressResolver::MatchType type = Exact);
43
44   // Creates a function breakpoint by regular expression.  Takes over control of
45   // the lifespan of func_regex.
46   AddressResolverName(RegularExpression &func_regex);
47
48   AddressResolverName(const char *class_name, const char *method,
49                       AddressResolver::MatchType type);
50
51   ~AddressResolverName() override;
52
53   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
54                                           SymbolContext &context, Address *addr,
55                                           bool containing) override;
56
57   Searcher::Depth GetDepth() override;
58
59   void GetDescription(Stream *s) override;
60
61 protected:
62   ConstString m_func_name;
63   ConstString m_class_name; // FIXME: Not used yet.  The idea would be to stop
64                             // on methods of this class.
65   RegularExpression m_regex;
66   AddressResolver::MatchType m_match_type;
67
68 private:
69   DISALLOW_COPY_AND_ASSIGN(AddressResolverName);
70 };
71
72 } // namespace lldb_private
73
74 #endif // liblldb_AddressResolverName_h_