diff options
author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2020-01-14 12:12:57 +0100 |
---|---|---|
committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2020-01-14 13:06:58 +0100 |
commit | 877723b7ce813d25fc4a358b7d2cb90468733a72 (patch) | |
tree | 41a92c0868e89ea31e051f65f1910e9f7cedee26 /lldb/packages/Python/lldbsuite/test | |
parent | e27632c3026328e41b0d7dbf25631041e979a2f9 (diff) | |
download | bcm5719-llvm-877723b7ce813d25fc4a358b7d2cb90468733a72.tar.gz bcm5719-llvm-877723b7ce813d25fc4a358b7d2cb90468733a72.zip |
[lldb/Expression] Improve interpreter error message with a non-running target
When trying to interpret an expression with a function call, if the
process hasn't been launched, the expression fails to be interpreted
and the user gets the following error message:
```error: Can't run the expression locally```
This message doesn't explain why the expression failed to be
interpreted, that's why this patch improves the error message that is
displayed when trying to run an expression while no process is running.
rdar://11991708
Differential Revision: https://reviews.llvm.org/D72510
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py b/lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py index 825e0be5b69..c70e90e7a26 100644 --- a/lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py @@ -35,7 +35,7 @@ class TestAllowJIT(TestBase): "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 @@ class TestAllowJIT(TestBase): # 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 @@ class TestAllowJIT(TestBase): # 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) |