-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
std.debug
: implement sparc*-linux
unwinding
#25569
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
+235
−57
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49a19cb
to
96fd1ea
Compare
cc @koachan you might be interested in this |
96fd1ea
to
eba6d0f
Compare
eba6d0f
to
1ed26f0
Compare
… PowerPC As for SPARC, FP-based unwinding is superior on these.
flushw and ta 3 flush all windows *except* the current one. So we need to do this in a new register window to get all of the ones we care about.
It's better to do this here than in StackIterator.init() so that std.debug.cpu_context.Native.current() isn't a footgun on SPARC.
It's not really a ucontext_t at all. Lovely stuff.
We're overwriting the memory that unwind_context sits in, so we need to do the getFp() call earlier.
… on signal I have no idea if this is a QEMU bug or real kernel behavior. Either way, the register save area specifically exists for asynchronous spilling of incoming and local registers, so there should be no harm in doing this.
The FP would point to the register save area for the previous frame, while the SP points to the register save area for the current frame. So use the latter.
The return address points to the call instruction on SPARC, so the actual return address is 8 bytes after. This means that we shouldn't do the return address adjustment that we normally do.
The way SPARC works due to its ABI built around register windows means that we can always do fast FP-based unwinding.
1ed26f0
to
e0f10da
Compare
koachan
reviewed
Oct 15, 2025
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements most of #25537.