[Lldb-commits] [PATCH] D119298: [lldb] Fix step-avoid-regexp logging

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 8 15:41:18 PST 2022

kastiglione created this revision.
kastiglione added a reviewer: jingham.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Ensure step-avoid-regexp logs are emitted in the case where the regex has no
capture groups.

Without this change, the log is printed only if the regex has at least one
capture group.

Another change is to the log message: the first capture group has been removed
from the message. There could be zero capture groups, and there could be two or
more capture groups.

  rG LLVM Github Monorepo



Index: lldb/source/Target/ThreadPlanStepInRange.cpp
--- lldb/source/Target/ThreadPlanStepInRange.cpp
+++ lldb/source/Target/ThreadPlanStepInRange.cpp
@@ -340,17 +340,13 @@
       if (frame_function_name) {
-        llvm::SmallVector<llvm::StringRef, 2> matches;
-        bool return_value =
-            avoid_regexp_to_use->Execute(frame_function_name, &matches);
-        if (return_value && matches.size() > 1) {
-          std::string match = matches[1].str();
+        bool return_value = avoid_regexp_to_use->Execute(frame_function_name);
+        if (return_value) {
-                    "Stepping out of function \"%s\" because it matches "
-                    "the avoid regexp \"%s\" - match substring: \"%s\".",
+                    "Stepping out of function \"%s\" because it matches the "
+                    "avoid regexp \"%s\".",
-                    avoid_regexp_to_use->GetText().str().c_str(),
-                    match.c_str());
+                    avoid_regexp_to_use->GetText().str().c_str());
         return return_value;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119298.407002.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220208/7d57846e/attachment-0001.bin>

More information about the lldb-commits mailing list