[Lldb-commits] [libcxx] [lldb] [lldb][libc++] Hide all libc++ implementation details from stacktraces (PR #108870)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 23 11:44:21 PDT 2024


================
@@ -90,9 +79,26 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
     if (!sc.function)
       return {};
 
+    // Check if we have a regex match
+    bool matches_regex = false;
     for (RegularExpression &r : m_hidden_regex)
-      if (r.Execute(sc.function->GetNameNoArguments()))
+      if (r.Execute(sc.function->GetNameNoArguments())) {
+        matches_regex = true;
+        break;
+      }
+
+    if (matches_regex) {
----------------
vogelsgesang wrote:

purely stylistic. I find the code easier to read if every section takes care of a single thing.

In this case, I find it more readable if we have two separate code blocks:
1. first the code block that check if we match the regular expression
2. then a separate code block which checks for the parent frame

But this is clearly a subjective argument. If you want me to write this in some other way, please let me know 🙂 

https://github.com/llvm/llvm-project/pull/108870


More information about the lldb-commits mailing list