apple / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Apple’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.1k stars 320 forks source link

Improve error handling in SwiftUserExpression #8808

Closed adrian-prantl closed 1 month ago

adrian-prantl commented 1 month ago

Previously this

$ swiftc test.swift -g -o test
$ lldb -o 'b main' -o 'b test' -o r -o 'e -i0 -- test()' ./test
(lldb) ^D

resulted in

Can't execute a swift expression without a runtime
UNREACHABLE executed at llvm-project/lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp:90!

after this patch it's

(lldb) ^D
error: Could not finish swift expression because the process is being torn down

Unfortunately catching this error in a test case is tricky.

adrian-prantl commented 1 month ago

@swift-ci test

adrian-prantl commented 1 month ago

@swift-ci test macos

adrian-prantl commented 1 month ago

@swift-ci test macos