Skip to content

Commit

Permalink
std.debug: Support sparc32 in StackIterator.init().
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp authored and andrewrk committed Aug 14, 2024
1 parent dc77d1b commit b470d2a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/std/debug.zig
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,12 @@ pub const StackIterator = struct {
} else void = if (have_ucontext) null else {},

pub fn init(first_address: ?usize, fp: ?usize) StackIterator {
if (native_arch == .sparc64) {
if (native_arch.isSPARC()) {
// Flush all the register windows on stack.
asm volatile (
\\ flushw
asm volatile (if (std.Target.sparc.featureSetHas(builtin.cpu.features, .v9))
"flushw"
else
"ta 3" // ST_FLUSH_WINDOWS
::: "memory");
}

Expand Down

0 comments on commit b470d2a

Please sign in to comment.