When expressions fail, they should report the expression stop reason not the restored thread stop reason
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
When you run an expression in lldb, even though it might cause the target to crash, hit a breakpoint, etc, we don't want to change the Thread's actual stop reason. For instance, if you hit a breakpoint and your breakpoint callback calls a function that crashes, you don't want the user to see the stop reason as an expression crash. That would be really confusing; this could be lldb calling the function on their behalf or some code they are using but don't comprehend.
So lldb stores the original stop reason and as part of cleaning up after the expression evaluation, lldb restores that as the stop reason for the thread. But then when it goes to report the expression failure reason, it does that AFTER the restoration, so you get messages like "expression stopped evaluating for reason 'step-over'" which doesn't make any sense.
We need to also hold onto the expression stop reason and use that for the error reporting.
This is slightly separate but it would also be useful in the case of expression crashes to capture the crashed stack, and display that along with the stop reason.
Contributor guide
Assessment
This issue has not been assessed yet.