https://github.com/Michael137 updated 
https://github.com/llvm/llvm-project/pull/177920

>From aaf3b8d90de29d548a718bb4b5415bcdb55ba164 Mon Sep 17 00:00:00 2001
From: Michael Buch <[email protected]>
Date: Mon, 26 Jan 2026 08:45:56 +0000
Subject: [PATCH 1/2] [lldb][test] Add SBExpressionOptions parameter to
 expect_expr

---
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 6bb4516948da5..b77d8e9fae3ab 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2575,6 +2575,7 @@ def expect_expr(
         result_value=None,
         result_type=None,
         result_children=None,
+        options=None,
     ):
         """
         Evaluates the given expression and verifies the result.
@@ -2584,6 +2585,7 @@ def expect_expr(
         :param result_type: The type that the expression result should have. 
None if the type should not be checked.
         :param result_children: The expected children of the expression result
                                 as a list of ValueChecks. None if the children 
shouldn't be checked.
+        :param options: Expression evaluation options. None if a default set 
of options should be used.
         """
         self.assertTrue(
             expr.strip() == expr,
@@ -2593,11 +2595,14 @@ def expect_expr(
         frame = self.frame()
         options = lldb.SBExpressionOptions()
 
-        # Disable fix-its that tests don't pass by accident.
-        options.SetAutoApplyFixIts(False)
+        if not options:
+            options = lldb.SBExpressionOptions()
 
-        # Set the usual default options for normal expressions.
-        options.SetIgnoreBreakpoints(True)
+            # Disable fix-its that tests don't pass by accident.
+            options.SetAutoApplyFixIts(False)
+
+            # Set the usual default options for normal expressions.
+            options.SetIgnoreBreakpoints(True)
 
         if self.frame().IsValid():
             options.SetLanguage(frame.GuessLanguage())

>From 0b55b74bb38186e3e715e0d297cf83f03557563b Mon Sep 17 00:00:00 2001
From: Michael Buch <[email protected]>
Date: Mon, 26 Jan 2026 10:40:59 +0000
Subject: [PATCH 2/2] fixup! remove existing options local variable

---
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index b77d8e9fae3ab..6034eca3b93f2 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2593,7 +2593,6 @@ def expect_expr(
         )
 
         frame = self.frame()
-        options = lldb.SBExpressionOptions()
 
         if not options:
             options = lldb.SBExpressionOptions()

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to