• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 LLDB_CORE_ADDRESSRESOLVERNAME_H
10 #define LLDB_CORE_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,
43                                           Address *addr) 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   AddressResolverName(const AddressResolverName &) = delete;
58   const AddressResolverName &operator=(const AddressResolverName &) = delete;
59 };
60 
61 } // namespace lldb_private
62 
63 #endif // LLDB_CORE_ADDRESSRESOLVERNAME_H
64