Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norio-nomura/swiftbacktrace
Stack traces for Swift on Mac and Linux using `libunwind`.
https://github.com/norio-nomura/swiftbacktrace
Last synced: about 1 month ago
JSON representation
Stack traces for Swift on Mac and Linux using `libunwind`.
- Host: GitHub
- URL: https://github.com/norio-nomura/swiftbacktrace
- Owner: norio-nomura
- License: mit
- Created: 2018-05-02T06:45:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-04T10:23:00.000Z (about 5 years ago)
- Last Synced: 2024-09-16T16:06:44.425Z (about 2 months ago)
- Language: Swift
- Size: 86.9 KB
- Stars: 17
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftBacktrace
[![SwiftPM](https://github.com/norio-nomura/SwiftBacktrace/workflows/SwiftPM/badge.svg)](https://launch-editor.github.com/actions?workflowID=SwiftPM&event=pull_request&nwo=norio-nomura%2FSwiftBacktrace)
[![Nightly](https://github.com/norio-nomura/SwiftBacktrace/workflows/Nightly/badge.svg)](https://launch-editor.github.com/actions?workflowID=Nightly&event=pull_request&nwo=norio-nomura%2FSwiftBacktrace)Stack traces for Swift on Mac and Linux using `libunwind`.
## Installation
`SwiftBacktrace` depends on `libunwind`.
### On macOS
compatible with pre-installed `/usr/lib/system/libunwind.dylib`.### On Linux
`libunwind8` installaion is required.
```
apt-get update && apt-get install -y libunwind8
```## Getting started
```swift
import SwiftBacktraceprint(backtrace().joined(separator: "\n")) // backtrace()
print(demangledBacktrace().joined(separator: "\n")) // demangled backtrace
```[Output example on Linux CI](https://circleci.com/gh/norio-nomura/SwiftBacktrace/16):
```
/root/project/.build/x86_64-unknown-linux/debug/SwiftBacktracePackageTests.xctest(SwiftBacktrace.callStackSymbols(_: Swift.Int, transform: ((module: Swift.String, name: Swift.String, offset: Swift.UInt64, address: Swift.Optional)) -> A) -> Swift.Array+0x87) [0x55f78f85c0b7]
/root/project/.build/x86_64-unknown-linux/debug/SwiftBacktracePackageTests.xctest(SwiftBacktrace.demangledBacktrace(Swift.Int) -> Swift.Array+0x80) [0x55f78f85ae10]
/root/project/.build/x86_64-unknown-linux/debug/SwiftBacktracePackageTests.xctest(SwiftBacktraceTests.SwiftBacktraceTests.test_backtrace() -> ()+0x4a5) [0x55f78f8608d5]
/root/project/.build/x86_64-unknown-linux/debug/SwiftBacktracePackageTests.xctest(partial apply forwarder for SwiftBacktraceTests.SwiftBacktraceTests.test_backtrace() -> ()+0x9) [0x55f78f861119]
```## Author
Norio Nomura
## License
This package is available under the MIT license. See the LICENSE file for more info.