]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
Restructure libz, place vendor files in contrib/zlib like other third
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Breakpoint / BreakpointResolverName.h
1 //===-- BreakpointResolverName.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_BreakpointResolverName_h_
11 #define liblldb_BreakpointResolverName_h_
12
13 // C Includes
14 // C++ Includes
15 #include <vector>
16 #include <string>
17
18 // Other libraries and framework includes
19 // Project includes
20 #include "lldb/Breakpoint/BreakpointResolver.h"
21 #include "lldb/Core/Module.h"
22
23 namespace lldb_private {
24
25 //----------------------------------------------------------------------
26 /// @class BreakpointResolverName BreakpointResolverName.h "lldb/Breakpoint/BreakpointResolverName.h"
27 /// @brief This class sets breakpoints on a given function name, either by exact match
28 /// or by regular expression.
29 //----------------------------------------------------------------------
30
31 class BreakpointResolverName:
32     public BreakpointResolver
33 {
34 public:
35
36     BreakpointResolverName (Breakpoint *bkpt,
37                             const char *name,
38                             uint32_t name_type_mask,
39                             lldb::LanguageType language,
40                             Breakpoint::MatchType type,
41                             lldb::addr_t offset,
42                             bool skip_prologue);
43
44     // This one takes an array of names.  It is always MatchType = Exact.
45     BreakpointResolverName (Breakpoint *bkpt,
46                             const char *names[],
47                             size_t num_names,
48                             uint32_t name_type_mask,
49                             lldb::LanguageType language,
50                             lldb::addr_t offset,
51                             bool skip_prologue);
52
53     // This one takes a C++ array of names.  It is always MatchType = Exact.
54     BreakpointResolverName (Breakpoint *bkpt,
55                             std::vector<std::string> names,
56                             uint32_t name_type_mask,
57                             lldb::LanguageType language,
58                             lldb::addr_t offset,
59                             bool skip_prologue);
60
61     // Creates a function breakpoint by regular expression.  Takes over control of the lifespan of func_regex.
62     BreakpointResolverName (Breakpoint *bkpt,
63                             RegularExpression &func_regex,
64                             lldb::LanguageType language,
65                             lldb::addr_t offset,
66                             bool skip_prologue);
67
68     BreakpointResolverName (Breakpoint *bkpt,
69                             const char *class_name,
70                             const char *method,
71                             Breakpoint::MatchType type,
72                             lldb::addr_t offset,
73                             bool skip_prologue);
74
75     ~BreakpointResolverName() override;
76
77     Searcher::CallbackReturn
78     SearchCallback (SearchFilter &filter,
79                     SymbolContext &context,
80                     Address *addr,
81                     bool containing) override;
82
83     Searcher::Depth
84     GetDepth () override;
85
86     void
87     GetDescription (Stream *s) override;
88
89     void
90     Dump (Stream *s) const override;
91
92     /// Methods for support type inquiry through isa, cast, and dyn_cast:
93     static inline bool classof(const BreakpointResolverName *) { return true; }
94     static inline bool classof(const BreakpointResolver *V) {
95         return V->getResolverID() == BreakpointResolver::NameResolver;
96     }
97
98     lldb::BreakpointResolverSP
99     CopyForBreakpoint (Breakpoint &breakpoint) override;
100
101 protected:
102     BreakpointResolverName(const BreakpointResolverName &rhs);
103
104     std::vector<Module::LookupInfo> m_lookups;
105     ConstString m_class_name;
106     RegularExpression m_regex;
107     Breakpoint::MatchType m_match_type;
108     lldb::LanguageType m_language;
109     bool m_skip_prologue;
110
111     void
112     AddNameLookup (const ConstString &name, uint32_t name_type_mask);
113 };
114
115 } // namespace lldb_private
116
117 #endif // liblldb_BreakpointResolverName_h_