1 //===-- AddressResolverName.h -----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_AddressResolverName_h_
10 #define liblldb_AddressResolverName_h_
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"
18 namespace lldb_private {
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.
27 class AddressResolverName : public AddressResolver {
29 AddressResolverName(const char *func_name,
30 AddressResolver::MatchType type = Exact);
32 // Creates a function breakpoint by regular expression. Takes over control
33 // of the lifespan of func_regex.
34 AddressResolverName(RegularExpression &func_regex);
36 AddressResolverName(const char *class_name, const char *method,
37 AddressResolver::MatchType type);
39 ~AddressResolverName() override;
41 Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
42 SymbolContext &context, Address *addr,
43 bool containing) override;
45 lldb::SearchDepth GetDepth() override;
47 void GetDescription(Stream *s) override;
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;
57 DISALLOW_COPY_AND_ASSIGN(AddressResolverName);
60 } // namespace lldb_private
62 #endif // liblldb_AddressResolverName_h_