]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
Merge clang 7.0.1 and several follow-up changes
[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 <string>
16 #include <vector>
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
27 /// "lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on
28 /// a given function name, either by exact match or by regular expression.
29 //----------------------------------------------------------------------
30
31 class BreakpointResolverName : public BreakpointResolver {
32 public:
33   BreakpointResolverName(Breakpoint *bkpt, const char *name,
34                          uint32_t name_type_mask, lldb::LanguageType language,
35                          Breakpoint::MatchType type, lldb::addr_t offset,
36                          bool skip_prologue);
37
38   // This one takes an array of names.  It is always MatchType = Exact.
39   BreakpointResolverName(Breakpoint *bkpt, const char *names[],
40                          size_t num_names, uint32_t name_type_mask,
41                          lldb::LanguageType language, lldb::addr_t offset,
42                          bool skip_prologue);
43
44   // This one takes a C++ array of names.  It is always MatchType = Exact.
45   BreakpointResolverName(Breakpoint *bkpt, std::vector<std::string> names,
46                          uint32_t name_type_mask, lldb::LanguageType language,
47                          lldb::addr_t offset, bool skip_prologue);
48
49   // Creates a function breakpoint by regular expression.  Takes over control
50   // of the lifespan of func_regex.
51   BreakpointResolverName(Breakpoint *bkpt, RegularExpression &func_regex,
52                          lldb::LanguageType language, lldb::addr_t offset,
53                          bool skip_prologue);
54
55   static BreakpointResolver *
56   CreateFromStructuredData(Breakpoint *bkpt,
57                            const StructuredData::Dictionary &data_dict,
58                            Status &error);
59
60   StructuredData::ObjectSP SerializeToStructuredData() override;
61
62   ~BreakpointResolverName() override;
63
64   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
65                                           SymbolContext &context, Address *addr,
66                                           bool containing) override;
67
68   Searcher::Depth GetDepth() override;
69
70   void GetDescription(Stream *s) override;
71
72   void Dump(Stream *s) const override;
73
74   /// Methods for support type inquiry through isa, cast, and dyn_cast:
75   static inline bool classof(const BreakpointResolverName *) { return true; }
76   static inline bool classof(const BreakpointResolver *V) {
77     return V->getResolverID() == BreakpointResolver::NameResolver;
78   }
79
80   lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override;
81
82 protected:
83   BreakpointResolverName(const BreakpointResolverName &rhs);
84
85   std::vector<Module::LookupInfo> m_lookups;
86   ConstString m_class_name;
87   RegularExpression m_regex;
88   Breakpoint::MatchType m_match_type;
89   lldb::LanguageType m_language;
90   bool m_skip_prologue;
91
92   void AddNameLookup(const ConstString &name, uint32_t name_type_mask);
93 };
94
95 } // namespace lldb_private
96
97 #endif // liblldb_BreakpointResolverName_h_