[Lldb-commits] [lldb] 02def06 - [lldb] Fix step-avoid-regexp logging

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 9 08:35:21 PST 2022


Author: Dave Lee
Date: 2022-03-09T08:35:15-08:00
New Revision: 02def06e60369d616456251cb0f8e60115287128

URL: https://github.com/llvm/llvm-project/commit/02def06e60369d616456251cb0f8e60115287128
DIFF: https://github.com/llvm/llvm-project/commit/02def06e60369d616456251cb0f8e60115287128.diff

LOG: [lldb] Fix step-avoid-regexp logging

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.

Differential Revision: https://reviews.llvm.org/D119298

Added: 
    

Modified: 
    lldb/source/Target/ThreadPlanStepInRange.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp
index b733540ee311c..17f2100b804fd 100644
--- a/lldb/source/Target/ThreadPlanStepInRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepInRange.cpp
@@ -340,17 +340,13 @@ bool ThreadPlanStepInRange::FrameMatchesAvoidCriteria() {
           sc.GetFunctionName(Mangled::ePreferDemangledWithoutArguments)
               .GetCString();
       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) {
           LLDB_LOGF(GetLog(LLDBLog::Step),
-                    "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\".",
                     frame_function_name,
-                    avoid_regexp_to_use->GetText().str().c_str(),
-                    match.c_str());
+                    avoid_regexp_to_use->GetText().str().c_str());
         }
         return return_value;
       }


        


More information about the lldb-commits mailing list