24 const std::unordered_set<std::string> &func_names,
bool exact_match)
26 m_regex(std::move(regex)), m_exact_match(exact_match),
27 m_function_names(func_names) {}
33 llvm::StringRef regex_string;
52 std::unordered_set<std::string> names_set;
56 if (success && names_array) {
57 size_t num_names = names_array->
GetSize();
58 for (
size_t i = 0; i < num_names; i++) {
59 std::optional<llvm::StringRef> maybe_name =
63 "BRFR::CFSD: Malformed element {0} in the names array.", i);
66 names_set.insert(std::string(*maybe_name));
70 return std::make_shared<BreakpointResolverFileRegex>(
71 nullptr, std::move(regex), names_set, exact_match);
87 names_array_sp->AddItem(item);
103 std::vector<uint32_t> line_matches;
104 context.
target_sp->GetSourceManager().FindLinesMatchingRegex(
108 uint32_t num_matches = line_matches.size();
109 for (uint32_t i = 0; i < num_matches; i++) {
118 std::vector<size_t> sc_to_remove;
119 for (
size_t i = 0; i < sc_list.
GetSize(); i++) {
128 sc_to_remove.push_back(i);
132 if (!sc_to_remove.empty()) {
133 std::vector<size_t>::reverse_iterator iter;
134 std::vector<size_t>::reverse_iterator rend = sc_to_remove.rend();
135 for (iter = sc_to_remove.rbegin(); iter != rend; iter++) {
141 const bool skip_prologue =
true;
155 s->
Printf(
"source regex = \"%s\", exact_match = %d",
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
"lldb/Breakpoint/BreakpointResolverFileRegex.h" This class sets breakpoints by file and line.
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 AddFunctionName(const char *func_name)
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
lldb::SearchDepth GetDepth() override
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)
RegularExpression m_regex
General Outline: The BreakpointResolver is a Searcher.
static const char * GetKey(OptionNames enum_value)
StructuredData::DictionarySP WrapOptionsDict(StructuredData::DictionarySP options_dict_sp)
void SetSCMatchesByLine(SearchFilter &filter, SymbolContextList &sc_list, bool skip_prologue, llvm::StringRef log_ident, uint32_t line=0, std::optional< uint16_t > column=std::nullopt)
Takes a symbol context list of matches which supposedly represent the same file and line number in a ...
A class that describes a compilation unit.
const FileSpec & GetPrimaryFile() const
Return the primary source spec associated with this compile unit.
void ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list, RealpathPrefixes *realpath_prefixes=nullptr)
Resolve symbol contexts by file and line.
@ ePreferDemangledWithoutArguments
llvm::StringRef GetText() const
Access the regular expression text.
General Outline: Provides the callback and search depth for the SearchFilter search.
@ eCallbackReturnContinue
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
std::optional< llvm::StringRef > GetItemAtIndexAsString(size_t idx) const
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
bool GetValueForKeyAsBoolean(llvm::StringRef key, bool &result) const
bool GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
std::shared_ptr< String > StringSP
std::shared_ptr< Array > ArraySP
Defines a list of symbol context objects.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
uint32_t GetSize() const
Get accessor for a symbol context list size.
bool RemoveContextAtIndex(size_t idx)
Defines a symbol context baton that can be handed other debug core functions.
CompileUnit * comp_unit
The CompileUnit for a given query.
lldb::TargetSP target_sp
The Target for a given query.
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