]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
Restructure libz, place vendor files in contrib/zlib like other third
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Breakpoint / BreakpointResolverFileRegex.h
1 //===-- BreakpointResolverFileRegex.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_BreakpointResolverFileRegex_h_
11 #define liblldb_BreakpointResolverFileRegex_h_
12
13 // C Includes
14 // C++ Includes
15 #include <set>
16 // Other libraries and framework includes
17 // Project includes
18 #include "lldb/Breakpoint/BreakpointResolver.h"
19 #include "lldb/Core/ConstString.h"
20
21 namespace lldb_private {
22
23 //----------------------------------------------------------------------
24 /// @class BreakpointResolverFileRegex BreakpointResolverFileRegex.h "lldb/Breakpoint/BreakpointResolverFileRegex.h"
25 /// @brief This class sets breakpoints by file and line.  Optionally, it will look for inlined
26 /// instances of the file and line specification.
27 //----------------------------------------------------------------------
28
29 class BreakpointResolverFileRegex :
30     public BreakpointResolver
31 {
32 public:
33     BreakpointResolverFileRegex (Breakpoint *bkpt,
34                                  RegularExpression &regex,
35                                  const std::unordered_set<std::string> &func_name_set,
36                                  bool exact_match);
37
38     ~BreakpointResolverFileRegex() override;
39
40     Searcher::CallbackReturn
41     SearchCallback (SearchFilter &filter,
42                     SymbolContext &context,
43                     Address *addr,
44                     bool containing) override;
45
46     Searcher::Depth
47     GetDepth () override;
48
49     void
50     GetDescription (Stream *s) override;
51
52     void
53     Dump (Stream *s) const override;
54     
55     void
56     AddFunctionName(const char *func_name);
57
58     /// Methods for support type inquiry through isa, cast, and dyn_cast:
59     static inline bool classof(const BreakpointResolverFileRegex *) { return true; }
60     static inline bool classof(const BreakpointResolver *V) {
61         return V->getResolverID() == BreakpointResolver::FileRegexResolver;
62     }
63
64     lldb::BreakpointResolverSP
65     CopyForBreakpoint (Breakpoint &breakpoint) override;
66
67 protected:
68     friend class Breakpoint;
69     RegularExpression m_regex; // This is the line expression that we are looking for.
70     bool m_exact_match;        // If true, then if the source we match is in a comment, we won't set a location there.
71     std::unordered_set<std::string> m_function_names; // Limit the search to functions in the comp_unit passed in.
72
73 private:
74     DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
75 };
76
77 } // namespace lldb_private
78
79 #endif // liblldb_BreakpointResolverFileRegex_h_