diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-11-04 08:29:18 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-11-04 08:29:42 +0100 |
| commit | af71694dd946a88bf0db55e4513223e344bfde40 (patch) | |
| tree | e3605ef12a6fb989ccdeb0a6d2e2c8c2bfb31cc0 /lib/std/debug/SelfInfo.zig | |
| parent | 4049be90de6a557c1ab522363fddbb71d3ccdb18 (diff) | |
| download | zig-af71694dd946a88bf0db55e4513223e344bfde40.tar.gz zig-af71694dd946a88bf0db55e4513223e344bfde40.zip | |
std.debug: Add handling for armeb, thumb, thumbeb, and aarch64_be.
Diffstat (limited to 'lib/std/debug/SelfInfo.zig')
| -rw-r--r-- | lib/std/debug/SelfInfo.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/debug/SelfInfo.zig b/lib/std/debug/SelfInfo.zig index 228458aaef..544cf0ac6f 100644 --- a/lib/std/debug/SelfInfo.zig +++ b/lib/std/debug/SelfInfo.zig @@ -1419,7 +1419,7 @@ pub fn unwindFrameMachO( return unwindFrameMachODwarf(context, ma, eh_frame orelse return error.MissingEhFrame, @intCast(encoding.value.x86_64.dwarf)); }, }, - .aarch64 => switch (encoding.mode.arm64) { + .aarch64, .aarch64_be => switch (encoding.mode.arm64) { .OLD => return error.UnimplementedUnwindEncoding, .FRAMELESS => blk: { const sp = (try regValueNative(context.thread_context, spRegNum(reg_context), reg_context)).*; @@ -1535,7 +1535,7 @@ pub const UnwindContext = struct { /// Some platforms use pointer authentication - the upper bits of instruction pointers contain a signature. /// This function clears these signature bits to make the pointer usable. pub inline fn stripInstructionPtrAuthCode(ptr: usize) usize { - if (native_arch == .aarch64) { + if (native_arch.isAARCH64()) { // `hint 0x07` maps to `xpaclri` (or `nop` if the hardware doesn't support it) // The save / restore is because `xpaclri` operates on x30 (LR) return asm ( @@ -1787,11 +1787,11 @@ pub fn supportsUnwinding(target: std.Target) bool { .linux, .netbsd, .freebsd, .openbsd, .macos, .ios, .solaris, .illumos => true, else => false, }, - .arm => switch (target.os.tag) { + .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { .linux => true, else => false, }, - .aarch64 => switch (target.os.tag) { + .aarch64, .aarch64_be => switch (target.os.tag) { .linux, .netbsd, .freebsd, .macos, .ios => true, else => false, }, @@ -2194,7 +2194,7 @@ pub const VirtualMachine = struct { /// the .undefined rule by default, but allows ABI authors to override that. fn getRegDefaultValue(reg_number: u8, context: *UnwindContext, out: []u8) !void { switch (builtin.cpu.arch) { - .aarch64 => { + .aarch64, .aarch64_be => { // Callee-saved registers are initialized as if they had the .same_value rule if (reg_number >= 19 and reg_number <= 28) { const src = try regBytes(context.thread_context, reg_number, context.reg_context); |
