[all-commits] [llvm/llvm-project] 2c9093: Revert "Make sure Target::EvaluateExpression() pas...
Adrian Prantl via All-commits
all-commits at lists.llvm.org
Mon Oct 17 17:28:10 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2c9093e649c4078c1083f489b72dda7ad54baea5
https://github.com/llvm/llvm-project/commit/2c9093e649c4078c1083f489b72dda7ad54baea5
Author: Adrian Prantl <aprantl at apple.com>
Date: 2022-10-17 (Mon, 17 Oct 2022)
Changed paths:
M lldb/source/Commands/CommandObjectExpression.cpp
M lldb/source/Target/Target.cpp
Log Message:
-----------
Revert "Make sure Target::EvaluateExpression() passes up an error instead of silently dropping it."
This reverts commit a31a5da3c7d7393749a43dbc678fd28fb94d07f6.
Commit: dd5c5f72e00dca0e2458139fec09b1a715cfb238
https://github.com/llvm/llvm-project/commit/dd5c5f72e00dca0e2458139fec09b1a715cfb238
Author: Adrian Prantl <aprantl at apple.com>
Date: 2022-10-17 (Mon, 17 Oct 2022)
Changed paths:
M lldb/source/Commands/CommandObjectExpression.cpp
M lldb/source/Target/Target.cpp
M lldb/test/API/commands/expression/context-object/TestContextObject.py
M lldb/test/API/commands/expression/fixits/TestFixIts.py
Log Message:
-----------
Make sure Target::EvaluateExpression() passes up an error instead of silently dropping it.
When UserExpression::Evaluate() fails and doesn't return a ValueObject there is no vehicle for returning the error in the return value.
This behavior can be observed by applying the following patch:
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index f1a311b7252c..58c03ccdb068 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2370,6 +2370,7 @@ UserExpression *Target::GetUserExpressionForLanguage(
Expression::ResultType desired_type,
const EvaluateExpressionOptions &options, ValueObject *ctx_obj,
Status &error) {
+ error.SetErrorStringWithFormat("Ha ha!"); return nullptr;
auto type_system_or_err = GetScratchTypeSystemForLanguage(language);
if (auto err = type_system_or_err.takeError()) {
error.SetErrorStringWithFormat(
and then running
$ lldb -o "p 1"
(lldb) p 1
(lldb)
This patch fixes this by creating an empty result ValueObject that wraps the error.
Differential Revision: https://reviews.llvm.org/D135998
Compare: https://github.com/llvm/llvm-project/compare/d5a99bf5e134...dd5c5f72e00d
More information about the All-commits
mailing list