]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/include/lldb/Core/AddressResolverName.h
MFC r355940:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / include / lldb / Core / AddressResolverName.h
1 //===-- AddressResolverName.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 liblldb_AddressResolverName_h_
10 #define liblldb_AddressResolverName_h_
11
12 #include "lldb/Core/AddressResolver.h"
13 #include "lldb/Core/SearchFilter.h"
14 #include "lldb/Utility/ConstString.h"
15 #include "lldb/Utility/RegularExpression.h"
16 #include "lldb/lldb-defines.h"
17
18 namespace lldb_private {
19 class Address;
20 class Stream;
21 class SymbolContext;
22
23 /// \class AddressResolverName AddressResolverName.h
24 /// "lldb/Core/AddressResolverName.h" This class finds addresses for a given
25 /// function name, either by exact match or by regular expression.
26
27 class AddressResolverName : public AddressResolver {
28 public:
29   AddressResolverName(const char *func_name,
30                       AddressResolver::MatchType type = Exact);
31
32   // Creates a function breakpoint by regular expression.  Takes over control
33   // of the lifespan of func_regex.
34   AddressResolverName(RegularExpression &func_regex);
35
36   AddressResolverName(const char *class_name, const char *method,
37                       AddressResolver::MatchType type);
38
39   ~AddressResolverName() override;
40
41   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
42                                           SymbolContext &context, Address *addr,
43                                           bool containing) override;
44
45   lldb::SearchDepth GetDepth() override;
46
47   void GetDescription(Stream *s) override;
48
49 protected:
50   ConstString m_func_name;
51   ConstString m_class_name; // FIXME: Not used yet.  The idea would be to stop
52                             // on methods of this class.
53   RegularExpression m_regex;
54   AddressResolver::MatchType m_match_type;
55
56 private:
57   DISALLOW_COPY_AND_ASSIGN(AddressResolverName);
58 };
59
60 } // namespace lldb_private
61
62 #endif // liblldb_AddressResolverName_h_