On-Crash Backtraces in Swift
swift.org
On-Crash Backtraces in Swift
1–10 of 21 posts
Re: On-Crash Backtraces in Swift
#2Just link your C++ (or whatever) project with The Swift runtime (swiftrt.o and libswiftCore.so), and there you have it without writing any Swift.
Re: On-Crash Backtraces in Swift
#3The best part of is that you can get all this goodness even without having Swift code in your codebase. Just link your C++ (or whatever) project with The Swift runtime (swiftrt.o and libswiftCore.so), and there you have it without writing any Swift.
Re: On-Crash Backtraces in Swift
#4The best part of is that you can get all this goodness even without having Swift code in your codebase. Just link your C++ (or whatever) project with The Swift runtime (swiftrt.o and libswiftCore.so), and there you have it without writing any Swift.
[0] https://www.sandordargo.com/blog/2022/09/21/cpp23-stacktrace...
[1] https://www.gnu.org/software/libc/manual/html_node/Backtrace...
Re: On-Crash Backtraces in Swift
#5Boo! Show me my system frames!
(Also, is this available in the Xcode toolchain yet?)
Re: On-Crash Backtraces in Swift
#6> The backtracer also skips over system frames and Swift thunks by default. Boo! Show me my system frames! (Also, is this available in the Xcode toolchain yet?)
Re: On-Crash Backtraces in Swift
#7I thought I did something wrong when the crash reported looked so different. I was unaware, that since the last time I did this (ubuntu->debian .deb), the compiler had changed its error reporting.
Props to the Swift team doing the good work, and please add a .deb to the binaries artefacts!
Re: On-Crash Backtraces in Swift
#8> The backtracer also skips over system frames and Swift thunks by default. Boo! Show me my system frames! (Also, is this available in the Xcode toolchain yet?)
> This feature is also available on macOS but is disabled by default. To enable it, set SWIFT_BACKTRACE=enable=yes and sign your program with the com.apple.security.get-task-allow entitlement.
Re: On-Crash Backtraces in Swift
#9The best part of is that you can get all this goodness even without having Swift code in your codebase. Just link your C++ (or whatever) project with The Swift runtime (swiftrt.o and libswiftCore.so), and there you have it without writing any Swift.
Looks like is already part of C++23 [0]. But if you must use an older C++, why link the entire Swift runtime rather than something GCC's builtin backtraces [1] or libbacktrace [2]? [0] https://www.sandordargo.com/blog/2022/09/21/cpp23-stacktrace... [1] https://www.gnu.org/software/libc/manual/html_node/Backtrace... [2] https://github.com/ianlancetaylor/libbacktrace
Re: On-Crash Backtraces in Swift
#10Does that get you a full Swift REPL like Python's debugger does?