This revision was automatically updated to reflect the committed changes.
Closed by commit rG877723b7ce81: [lldb/Expression] Improve interpreter error 
message with a non-running target (authored by mib).

Changed prior to commit:
  https://reviews.llvm.org/D72510?vs=237917&id=237932#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72510/new/

https://reviews.llvm.org/D72510

Files:
  
lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp


Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -1258,8 +1258,9 @@
           interpret_error, interpret_function_calls);
 
       if (!can_interpret && execution_policy == eExecutionPolicyNever) {
-        err.SetErrorStringWithFormat("Can't run the expression locally: %s",
-                                     interpret_error.AsCString());
+        err.SetErrorStringWithFormat(
+            "Can't evaluate the expression without a running target due to: 
%s",
+            interpret_error.AsCString());
         return err;
       }
     }
Index: 
lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
===================================================================
--- 
lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
+++ 
lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
@@ -35,7 +35,7 @@
                                    "Set a breakpoint here", 
self.main_source_file)
 
         frame = thread.GetFrameAtIndex(0)
-        
+
         # First make sure we can call the function with 
         interp = self.dbg.GetCommandInterpreter()
         self.expect("expr --allow-jit 1 -- call_me(10)",
@@ -43,8 +43,8 @@
         # Now make sure it fails with the "can't IR interpret message" if 
allow-jit is false:
         self.expect("expr --allow-jit 0 -- call_me(10)",
                     error=True,
-                    substrs = ["Can't run the expression locally"])
-        
+                    substrs = ["Can't evaluate the expression without a 
running target"])
+
     def expr_options_test(self):
         (target, process, thread, bkpt) = 
lldbutil.run_to_source_breakpoint(self,
                                    "Set a breakpoint here", 
self.main_source_file)
@@ -69,7 +69,7 @@
         # Again use it and ensure we fail:
         result = frame.EvaluateExpression("call_me(10)", options)
         self.assertTrue(result.GetError().Fail(), "expression failed with no 
JIT")
-        self.assertTrue("Can't run the expression locally" in 
result.GetError().GetCString(), "Got right error")
+        self.assertTrue("Can't evaluate the expression without a running 
target" in result.GetError().GetCString(), "Got right error")
 
         # Finally set the allow JIT value back to true and make sure that 
works:
         options.SetAllowJIT(True)


Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -1258,8 +1258,9 @@
           interpret_error, interpret_function_calls);
 
       if (!can_interpret && execution_policy == eExecutionPolicyNever) {
-        err.SetErrorStringWithFormat("Can't run the expression locally: %s",
-                                     interpret_error.AsCString());
+        err.SetErrorStringWithFormat(
+            "Can't evaluate the expression without a running target due to: %s",
+            interpret_error.AsCString());
         return err;
       }
     }
Index: lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
+++ lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
@@ -35,7 +35,7 @@
                                    "Set a breakpoint here", self.main_source_file)
 
         frame = thread.GetFrameAtIndex(0)
-        
+
         # First make sure we can call the function with 
         interp = self.dbg.GetCommandInterpreter()
         self.expect("expr --allow-jit 1 -- call_me(10)",
@@ -43,8 +43,8 @@
         # Now make sure it fails with the "can't IR interpret message" if allow-jit is false:
         self.expect("expr --allow-jit 0 -- call_me(10)",
                     error=True,
-                    substrs = ["Can't run the expression locally"])
-        
+                    substrs = ["Can't evaluate the expression without a running target"])
+
     def expr_options_test(self):
         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
                                    "Set a breakpoint here", self.main_source_file)
@@ -69,7 +69,7 @@
         # Again use it and ensure we fail:
         result = frame.EvaluateExpression("call_me(10)", options)
         self.assertTrue(result.GetError().Fail(), "expression failed with no JIT")
-        self.assertTrue("Can't run the expression locally" in result.GetError().GetCString(), "Got right error")
+        self.assertTrue("Can't evaluate the expression without a running target" in result.GetError().GetCString(), "Got right error")
 
         # Finally set the allow JIT value back to true and make sure that works:
         options.SetAllowJIT(True)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to