1 //===-- BreakpointResolverFileRegex.h ----------------------------*- C++
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef liblldb_BreakpointResolverFileRegex_h_
12 #define liblldb_BreakpointResolverFileRegex_h_
15 #include "lldb/Breakpoint/BreakpointResolver.h"
16 #include "lldb/Utility/ConstString.h"
18 namespace lldb_private {
20 //----------------------------------------------------------------------
21 /// @class BreakpointResolverFileRegex BreakpointResolverFileRegex.h
22 /// "lldb/Breakpoint/BreakpointResolverFileRegex.h" This class sets
23 /// breakpoints by file and line. Optionally, it will look for inlined
24 /// instances of the file and line specification.
25 //----------------------------------------------------------------------
27 class BreakpointResolverFileRegex : public BreakpointResolver {
29 BreakpointResolverFileRegex(
30 Breakpoint *bkpt, RegularExpression ®ex,
31 const std::unordered_set<std::string> &func_name_set, bool exact_match);
33 static BreakpointResolver *
34 CreateFromStructuredData(Breakpoint *bkpt,
35 const StructuredData::Dictionary &options_dict,
38 StructuredData::ObjectSP SerializeToStructuredData() override;
40 ~BreakpointResolverFileRegex() override;
42 Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
43 SymbolContext &context, Address *addr,
44 bool containing) override;
46 lldb::SearchDepth GetDepth() override;
48 void GetDescription(Stream *s) override;
50 void Dump(Stream *s) const override;
52 void AddFunctionName(const char *func_name);
54 /// Methods for support type inquiry through isa, cast, and dyn_cast:
55 static inline bool classof(const BreakpointResolverFileRegex *) {
58 static inline bool classof(const BreakpointResolver *V) {
59 return V->getResolverID() == BreakpointResolver::FileRegexResolver;
62 lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override;
65 friend class Breakpoint;
67 m_regex; // This is the line expression that we are looking for.
68 bool m_exact_match; // If true, then if the source we match is in a comment,
69 // we won't set a location there.
70 std::unordered_set<std::string> m_function_names; // Limit the search to
72 // comp_unit passed in.
75 DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
78 } // namespace lldb_private
80 #endif // liblldb_BreakpointResolverFileRegex_h_