1 //===-- BreakpointResolverFileRegex.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_BreakpointResolverFileRegex_h_
11 #define liblldb_BreakpointResolverFileRegex_h_
16 // Other libraries and framework includes
18 #include "lldb/Breakpoint/BreakpointResolver.h"
19 #include "lldb/Core/ConstString.h"
21 namespace lldb_private {
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 //----------------------------------------------------------------------
29 class BreakpointResolverFileRegex :
30 public BreakpointResolver
33 BreakpointResolverFileRegex (Breakpoint *bkpt,
34 RegularExpression ®ex,
35 const std::unordered_set<std::string> &func_name_set,
38 ~BreakpointResolverFileRegex() override;
40 Searcher::CallbackReturn
41 SearchCallback (SearchFilter &filter,
42 SymbolContext &context,
44 bool containing) override;
50 GetDescription (Stream *s) override;
53 Dump (Stream *s) const override;
56 AddFunctionName(const char *func_name);
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;
64 lldb::BreakpointResolverSP
65 CopyForBreakpoint (Breakpoint &breakpoint) override;
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.
74 DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
77 } // namespace lldb_private
79 #endif // liblldb_BreakpointResolverFileRegex_h_