As a general rule LLDB itself should never crash, so you should definitely
file a bug about this. Please post your bug number, just for the record. Make sure to include your crash report. Also, if you can include a project that reproduces the issue, that’d be great.
Looking at the crash I see this:
Code Block Thread 4 Crashed: |
0 … lldb_private::Status::Fail() const + 4 |
1 … lldb_private::Target::GetScratchSwiftASTContext(lldb_private::Status&, lldb_private::ExecutionContextS… |
2 … lldb_private::SwiftUserExpression::ScanContext(lldb_private::ExecutionContext&, lldb_private::Status&)… |
3 … lldb_private::SwiftUserExpression::Parse(lldb_private::DiagnosticManager&, lldb_private::ExecutionCont… |
4 … lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&, lldb_private::EvaluateExpressi… |
5 … lldb_private::Target::EvaluateExpression(llvm::StringRef, lldb_private::ExecutionContextScope*, lldb_p… |
6 … lldb_private::CommandObjectExpression::EvaluateExpression(llvm::StringRef, lldb_private::Stream&, lldb… |
7 … lldb_private::CommandObjectExpression::DoExecute(llvm::StringRef, lldb_private::CommandReturnObject&) … |
8 … lldb_private::CommandObjectRaw::Execute(char const*, lldb_private::CommandReturnObject&) + 418 |
9 … lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::Com… |
10 … lldb::SBCommandInterpreter::HandleCommand(char const*, lldb::SBExecutionContext&, lldb::SBCommandRetur… |
… |
This seems pretty fundamental. The
po command has caused LLDB to start up a Swift expression parser, which has then crashed trying to set up a context. We’ve made some improvements in this space in Xcode 12.5 beta (r. 67587895), so you should give that a try.
If that doesn’t help I can’t see a clear path forward. Does the expression you’re parsing rely on Swift? If not, you could force the language to something other than Swift.
Code Block (lldb) po 123 |
(lldb) # `po` is an alias for `expression -O --`. |
(lldb) expr -O -- 123 |
(lldb) # And you can force Objective-C using `-l objc`. |
(lldb) expr -O -l objc -- 123 |
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"