[Lldb-commits] [PATCH] D72510: [lldb/Expression] Improve interpreter error message with a non-running target
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 13 00:25:34 PST 2020
teemperor requested changes to this revision.
teemperor added a comment.
This revision now requires changes to proceed.
To give this more context: The IRInterpreter can interpret function calls but only on Hexagon (see D9404 <https://reviews.llvm.org/D9404>). The reason why we essentially always see this error message when the target isn't running is because most people don't target Hexagon and function calls is the most common reason `IRInterpreter::CanInterpret` returns an error. However, it *could* also fail for any of the other error messages in this function.
So while the idea of the patch is great (the error message is very confusing), this is not the right place to mention a non-running target. We ask the IRInterpretet if it can interpret the expression and it should answer with why it can't interpret it. The reason is that it can't interpret function calls (in this regard the error message can be improved here). If we start talking about a running target here then we also need to add this same text to all other error messages (in fact, we would need to replace all other error message with this to be consistent). It also makes the error message an oxymoron:
error: Interpreting the expression locally failed:
Interpreter requires to run the program to interprete the expression
I would go up to the ClangExpressionParser and fix the error message there:
if (!can_interpret && execution_policy == eExecutionPolicyNever) {
err.SetErrorStringWithFormat("Can't run the expression locally: %s",
interpret_error.AsCString());
return err;
}
This could be something like "Can't interpret the expression without a running target. Interpretation failed due to: %s" or something like that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72510/new/
https://reviews.llvm.org/D72510
More information about the lldb-commits
mailing list