Skip to content

Optionally symbolicate backtraces. #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 12, 2024
Merged

Optionally symbolicate backtraces. #676

merged 5 commits into from
Sep 12, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Sep 10, 2024

This PR adds the ability to symbolicate backtraces on Darwin and Windows. A few different modes are provided: mangled, demangled, and "precise demangled" (which includes symbol addresses and instruction pointer offsets.) Tools such as the Swift VS Code plugin will be able to adopt this new feature along with VS Code's new call stacks API (microsoft/vscode#222126).

Note that on Linux, it is not currently possible to symbolicate backtraces meaningfully. The standard library's Backtrace type has the ability to do this for us, but we'll need some tweaks to its interface before we can adopt it.

Note also that Apple's internal Core Symbolication framework is not used; we may be able to add support for it in a future PR (or Apple may opt to use it in their internal fork of Swift Testing.)

There is no way to emit backtraces to the command line right now. I considered having --very-verbose imply backtraces, but it's something I'm going to reserve for a future PR after discussion with the community.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan grynspan added enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs windows 🪟 Windows support darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support labels Sep 10, 2024
@grynspan grynspan added this to the Swift 6.1 milestone Sep 10, 2024
@grynspan grynspan self-assigned this Sep 10, 2024
@grynspan
Copy link
Contributor Author

@swift-ci test

1 similar comment
@grynspan
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@plemarquand plemarquand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

This PR adds the ability to symbolicate backtraces on Darwin and Windows. A few
different modes are provided: mangled, demangled, and "precise demangled" (which
includes symbol addresses and instruction pointer offsets.) Tools such as the
Swift VS Code plugin will be able to adopt this new feature along with VS Code's
new call stacks API (microsoft/vscode#222126).

Note that on Linux, it is not currently possible to symbolicate backtraces
meaningfully. The standard library's `Backtrace` type has the ability to do this
for us, but we'll need some tweaks to its interface before we can adopt it.

Note also that Apple's internal Core Symbolication framework is not used; we may
be able to add support for it in a future PR (or Apple may opt to use it in
their internal fork of Swift Testing.)

There is no way to emit backtraces to the command line right now. I considered
having `--very-verbose` imply backtraces, but it's something I'm going to
reserve for a future PR after discussion with the community.
…ace as structured values and let the JSON consumer construct a single string as desired
@grynspan grynspan force-pushed the jgrynspan/symbolication branch from 4caa65d to 8e235ef Compare September 11, 2024 21:28
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan merged commit dab00ae into main Sep 12, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/symbolication branch September 12, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs windows 🪟 Windows support
Development

Successfully merging this pull request may close these issues.

4 participants