Hello,
I wondering, whether this is a bug or a feature. I have a valid top-level Clang expression, but LLDB returns an ‘unknown error’ upon successful evaluation.
Reproduction steps:
We need to have a runnable target in order to evaluate top-level expression.
- Create a running target.
- Invoke
script
command - Prepare Options for expression evaluator:
>>> opt = lldb.SBExpressionOptions()
>>> opt.SetTopLevel()
- Evalute the expression:
lldb.frame.EvaluateExpression("struct Foo { int bar; };", opt)
Error: 'unknown error'
is returned, but the expression has been evaluated.lldb.frame.EvaluateExpression("struct Foo aaa = {1}; aaa")
returns(struct Foo) $0 = (bar = 1)
Is this an expected outcome? If so, is it OK to just “ignore” errors with description equal to “unknown error”?