Skip to content

Commit 95bdb0c

Browse files
committed
std.debug.Dwarf.SelfUnwinder: default some s390x registers to the same-value rule
1 parent 8263f55 commit 95bdb0c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/std/debug/Dwarf/SelfUnwinder.zig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,13 @@ fn nextInner(unwinder: *SelfUnwinder, gpa: Allocator, cache_entry: *const CacheE
197197
// If unspecified, we'll use the default rule for the return address register, which is
198198
// typically equivalent to `.undefined` (meaning there is no return address), but may be
199199
// overriden by ABIs.
200-
var has_return_address: bool = builtin.cpu.arch.isAARCH64() and
201-
return_address_register >= 19 and
202-
return_address_register <= 28;
200+
var has_return_address: bool = switch (builtin.cpu.arch) {
201+
// DWARF for the Arm 64-bit Architecture (AArch64) §4.3, p1
202+
.aarch64, .aarch64_be => return_address_register >= 19 and return_address_register <= 28,
203+
// ELF ABI s390x Supplement §1.6.4
204+
.s390x => return_address_register >= 6 and return_address_register <= 15,
205+
else => false,
206+
};
203207

204208
// Create a copy of the CPU state, to which we will apply the new rules.
205209
var new_cpu_state = unwinder.cpu_state;

0 commit comments

Comments
 (0)