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



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to