Skip to content

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Oct 14, 2025

Implements most of #25537.

@alexrp
Copy link
Member Author

alexrp commented Oct 14, 2025

cc @koachan you might be interested in this

alexrp added 14 commits October 15, 2025 13:59
… 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.
@alexrp alexrp disabled auto-merge October 15, 2025 13:33
@alexrp alexrp enabled auto-merge October 15, 2025 15:45
@alexrp
Copy link
Member Author

alexrp commented Oct 16, 2025

x86_64-linux-debug-llvm timeout is resolved by 493ad58.

@alexrp alexrp disabled auto-merge October 16, 2025 08:13
@alexrp alexrp enabled auto-merge October 16, 2025 08:13
@alexrp alexrp disabled auto-merge October 16, 2025 08:14
@alexrp alexrp merged commit 48f8133 into ziglang:master Oct 16, 2025
16 of 18 checks passed
@alexrp alexrp deleted the std-debug-sparc branch October 16, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants