LLDB mainline
BreakpointResolverFileRegex.h
Go to the documentation of this file.
1//===-- BreakpointResolverFileRegex.h ----------------------------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILEREGEX_H
11#define LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILEREGEX_H
12
14#include <set>
15
16namespace lldb_private {
17
18/// \class BreakpointResolverFileRegex BreakpointResolverFileRegex.h
19/// "lldb/Breakpoint/BreakpointResolverFileRegex.h" This class sets
20/// breakpoints by file and line. Optionally, it will look for inlined
21/// instances of the file and line specification.
22
24public:
26 const lldb::BreakpointSP &bkpt, RegularExpression regex,
27 const std::unordered_set<std::string> &func_name_set, bool exact_match);
28
31 Status &error);
32
34
35 ~BreakpointResolverFileRegex() override = default;
36
38 SymbolContext &context,
39 Address *addr) override;
40
41 lldb::SearchDepth GetDepth() override;
42
43 void GetDescription(Stream *s) override;
44
45 void Dump(Stream *s) const override;
46
47 void AddFunctionName(const char *func_name);
48
49 /// Methods for support type inquiry through isa, cast, and dyn_cast:
50 static inline bool classof(const BreakpointResolverFileRegex *) {
51 return true;
52 }
53 static inline bool classof(const BreakpointResolver *V) {
55 }
56
58 CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
59
60protected:
61 friend class Breakpoint;
63 m_regex; // This is the line expression that we are looking for.
64 bool m_exact_match; // If true, then if the source we match is in a comment,
65 // we won't set a location there.
66 std::unordered_set<std::string> m_function_names; // Limit the search to
67 // functions in the
68 // comp_unit passed in.
69
70private:
74};
75
76} // namespace lldb_private
77
78#endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILEREGEX_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Definition Address.h:62
const BreakpointResolverFileRegex & operator=(const BreakpointResolverFileRegex &)=delete
BreakpointResolverFileRegex(const BreakpointResolverFileRegex &)=delete
StructuredData::ObjectSP SerializeToStructuredData() override
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
std::unordered_set< std::string > m_function_names
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
static bool classof(const BreakpointResolver *V)
static bool classof(const BreakpointResolverFileRegex *)
Methods for support type inquiry through isa, cast, and dyn_cast:
BreakpointResolverFileRegex(const lldb::BreakpointSP &bkpt, RegularExpression regex, const std::unordered_set< std::string > &func_name_set, bool exact_match)
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
static lldb::BreakpointResolverSP CreateFromStructuredData(const StructuredData::Dictionary &options_dict, Status &error)
unsigned getResolverID() const
getResolverID - Return an ID for the concrete type of this object.
BreakpointResolver(const lldb::BreakpointSP &bkpt, unsigned char resolverType, lldb::addr_t offset=0, bool offset_is_insn_count=false)
The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint to make sense.
General Outline: Provides the callback and search depth for the SearchFilter search.
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
std::shared_ptr< Object > ObjectSP
Defines a symbol context baton that can be handed other debug core functions.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP