1 //===-- BreakpointResolverName.h --------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_BreakpointResolverName_h_
11 #define liblldb_BreakpointResolverName_h_
17 // Other libraries and framework includes
19 #include "lldb/Breakpoint/BreakpointResolver.h"
21 namespace lldb_private {
23 //----------------------------------------------------------------------
24 /// @class BreakpointResolverName BreakpointResolverName.h "lldb/Breakpoint/BreakpointResolverName.h"
25 /// @brief This class sets breakpoints on a given function name, either by exact match
26 /// or by regular expression.
27 //----------------------------------------------------------------------
29 class BreakpointResolverName:
30 public BreakpointResolver
34 BreakpointResolverName (Breakpoint *bkpt,
36 uint32_t name_type_mask,
37 Breakpoint::MatchType type,
40 // This one takes an array of names. It is always MatchType = Exact.
41 BreakpointResolverName (Breakpoint *bkpt,
44 uint32_t name_type_mask,
47 // This one takes a C++ array of names. It is always MatchType = Exact.
48 BreakpointResolverName (Breakpoint *bkpt,
49 std::vector<std::string> names,
50 uint32_t name_type_mask,
53 // Creates a function breakpoint by regular expression. Takes over control of the lifespan of func_regex.
54 BreakpointResolverName (Breakpoint *bkpt,
55 RegularExpression &func_regex,
58 BreakpointResolverName (Breakpoint *bkpt,
59 const char *class_name,
61 Breakpoint::MatchType type,
65 ~BreakpointResolverName ();
67 virtual Searcher::CallbackReturn
68 SearchCallback (SearchFilter &filter,
69 SymbolContext &context,
73 virtual Searcher::Depth
77 GetDescription (Stream *s);
80 Dump (Stream *s) const;
82 /// Methods for support type inquiry through isa, cast, and dyn_cast:
83 static inline bool classof(const BreakpointResolverName *) { return true; }
84 static inline bool classof(const BreakpointResolver *V) {
85 return V->getResolverID() == BreakpointResolver::NameResolver;
92 ConstString lookup_name;
93 uint32_t name_type_mask; // See FunctionNameType
94 bool match_name_after_lookup;
100 match_name_after_lookup (false)
105 Prune (SymbolContextList &sc_list,
106 size_t start_idx) const;
108 std::vector<LookupInfo> m_lookups;
109 ConstString m_class_name;
110 RegularExpression m_regex;
111 Breakpoint::MatchType m_match_type;
112 bool m_skip_prologue;
115 AddNameLookup (const ConstString &name, uint32_t name_type_mask);
117 DISALLOW_COPY_AND_ASSIGN(BreakpointResolverName);
120 } // namespace lldb_private
122 #endif // liblldb_BreakpointResolverName_h_