]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
Merge OpenSSL 1.0.2o.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Breakpoint / BreakpointResolverFileRegex.h
1 //===-- BreakpointResolverFileRegex.h ----------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef liblldb_BreakpointResolverFileRegex_h_
12 #define liblldb_BreakpointResolverFileRegex_h_
13
14 // C Includes
15 // C++ Includes
16 #include <set>
17 // Other libraries and framework includes
18 // Project includes
19 #include "lldb/Breakpoint/BreakpointResolver.h"
20 #include "lldb/Utility/ConstString.h"
21
22 namespace lldb_private {
23
24 //----------------------------------------------------------------------
25 /// @class BreakpointResolverFileRegex BreakpointResolverFileRegex.h
26 /// "lldb/Breakpoint/BreakpointResolverFileRegex.h"
27 /// @brief This class sets breakpoints by file and line.  Optionally, it will
28 /// look for inlined
29 /// instances of the file and line specification.
30 //----------------------------------------------------------------------
31
32 class BreakpointResolverFileRegex : public BreakpointResolver {
33 public:
34   BreakpointResolverFileRegex(
35       Breakpoint *bkpt, RegularExpression &regex,
36       const std::unordered_set<std::string> &func_name_set, bool exact_match);
37
38   static BreakpointResolver *
39   CreateFromStructuredData(Breakpoint *bkpt,
40                            const StructuredData::Dictionary &options_dict,
41                            Status &error);
42
43   StructuredData::ObjectSP SerializeToStructuredData() override;
44
45   ~BreakpointResolverFileRegex() override;
46
47   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
48                                           SymbolContext &context, Address *addr,
49                                           bool containing) override;
50
51   Searcher::Depth GetDepth() override;
52
53   void GetDescription(Stream *s) override;
54
55   void Dump(Stream *s) const override;
56
57   void AddFunctionName(const char *func_name);
58
59   /// Methods for support type inquiry through isa, cast, and dyn_cast:
60   static inline bool classof(const BreakpointResolverFileRegex *) {
61     return true;
62   }
63   static inline bool classof(const BreakpointResolver *V) {
64     return V->getResolverID() == BreakpointResolver::FileRegexResolver;
65   }
66
67   lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override;
68
69 protected:
70   friend class Breakpoint;
71   RegularExpression
72       m_regex;        // This is the line expression that we are looking for.
73   bool m_exact_match; // If true, then if the source we match is in a comment,
74                       // we won't set a location there.
75   std::unordered_set<std::string> m_function_names; // Limit the search to
76                                                     // functions in the
77                                                     // comp_unit passed in.
78
79 private:
80   DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
81 };
82
83 } // namespace lldb_private
84
85 #endif // liblldb_BreakpointResolverFileRegex_h_