3 ms·
Looks like <stacktrace> 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 ba
by eatonphil 3y ago
Looks like <stacktrace> 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-library https://www.sandordargo.com/blog/2022/09/21/cpp23-stacktrace...
[1] https://www.gnu.org/software/libc/manual/html_node/Backtraces.html https://www.gnu.org/software/libc/manual/html_node/Backtrace...
[2] https://github.com/ianlancetaylor/libbacktrace https://github.com/ianlancetaylor/libbacktrace
- favorited 3y agoIf you're on the Mac, your process is probably linking the Swift runtime anyway. Foundation.framework is being reimplemented in Swift, so if your process links Foundation (or even just CF), you've got the Swift runtime.
- anarazel 3y agoI don't think <stacktrace> is async signal safe, and thus shouldn't be used for in-process crash reporting.
- yaglo 3y agoIt’s a nicer experience during development out of the box, without having to do anything manually. Swift Backtracing is not only about the symbols, it’s also interactive and lets you attach the debugger after the process crashes, which is neat.