[Lldb-commits] [lldb] 68a1593 - [lldb] Support non-default libc++ ABI namespace

Petr Hosek via lldb-commits lldb-commits at lists.llvm.org
Sun Aug 25 18:23:17 PDT 2024


Author: Petr Hosek
Date: 2024-08-26T01:23:09Z
New Revision: 68a1593a59c3d50aff43ef4f82ded224fc6a25db

URL: https://github.com/llvm/llvm-project/commit/68a1593a59c3d50aff43ef4f82ded224fc6a25db
DIFF: https://github.com/llvm/llvm-project/commit/68a1593a59c3d50aff43ef4f82ded224fc6a25db.diff

LOG: [lldb] Support non-default libc++ ABI namespace

This is a fix forward for the issue introduced in #104523.

Added: 
    

Modified: 
    lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
    lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
index c60200ab186d09..1e4a2cbb1133f7 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
@@ -54,7 +54,7 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
 public:
   LibCXXFrameRecognizer()
       : m_hidden_function_regex(
-            R"(^std::__1::(__function.*::operator\(\)|__invoke))"
+            R"(^std::__.*::(__function.*::operator\(\)|__invoke))"
             R"((\[.*\])?)"    // ABI tag.
             R"(( const)?$)"), // const.
         m_hidden_frame(new LibCXXHiddenFrame()) {}
@@ -81,7 +81,7 @@ CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
   if (process)
     process->GetTarget().GetFrameRecognizerManager().AddRecognizer(
         StackFrameRecognizerSP(new LibCXXFrameRecognizer()), {},
-        std::make_shared<RegularExpression>("^std::__1::"),
+        std::make_shared<RegularExpression>("^std::__.*::"),
         /*first_instruction_only*/ false);
 }
 

diff  --git a/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py b/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
index 30fe3ecb1e4bf4..8d4b6bfe17166e 100644
--- a/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
+++ b/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
@@ -21,18 +21,18 @@ def test_backtrace(self):
             substrs=["frame", "foo", "frame", "main"],
         )
         self.expect(
-            "thread backtrace", matching=False, patterns=["frame.*std::__1::__function"]
+            "thread backtrace", matching=False, patterns=["frame.*std::__.*::__function"]
         )
         # Unfiltered.
         self.expect(
             "thread backtrace -u",
             ordered=True,
-            patterns=["frame.*foo", "frame.*std::__1::__function", "frame.*main"],
+            patterns=["frame.*foo", "frame.*std::__.*::__function", "frame.*main"],
         )
         self.expect(
             "thread backtrace --unfiltered",
             ordered=True,
-            patterns=["frame.*foo", "frame.*std::__1::__function", "frame.*main"],
+            patterns=["frame.*foo", "frame.*std::__.*::__function", "frame.*main"],
         )
 
     @add_test_categories(["libc++"])


        


More information about the lldb-commits mailing list