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" 15 #include "lldb/Utility/ConstString.h" 16 #include "lldb/Utility/RegularExpression.h" 17 #include "lldb/lldb-defines.h" 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" This class finds addresses for a given 34 /// function name, either by exact match or by regular expression. 35 //---------------------------------------------------------------------- 36 37 class AddressResolverName : public AddressResolver { 38 public: 39 AddressResolverName(const char *func_name, 40 AddressResolver::MatchType type = Exact); 41 42 // Creates a function breakpoint by regular expression. Takes over control 43 // of the lifespan of func_regex. 44 AddressResolverName(RegularExpression &func_regex); 45 46 AddressResolverName(const char *class_name, const char *method, 47 AddressResolver::MatchType type); 48 49 ~AddressResolverName() override; 50 51 Searcher::CallbackReturn SearchCallback(SearchFilter &filter, 52 SymbolContext &context, Address *addr, 53 bool containing) override; 54 55 lldb::SearchDepth GetDepth() override; 56 57 void GetDescription(Stream *s) override; 58 59 protected: 60 ConstString m_func_name; 61 ConstString m_class_name; // FIXME: Not used yet. The idea would be to stop 62 // on methods of this class. 63 RegularExpression m_regex; 64 AddressResolver::MatchType m_match_type; 65 66 private: 67 DISALLOW_COPY_AND_ASSIGN(AddressResolverName); 68 }; 69 70 } // namespace lldb_private 71 72 #endif // liblldb_AddressResolverName_h_ 73