| author | |
| committer | |
| log | af71694dd946a88bf0db55e4513223e344bfde40 |
| tree | e3605ef12a6fb989ccdeb0a6d2e2c8c2bfb31cc0 |
| parent | 4049be90de6a557c1ab522363fddbb71d3ccdb18 |
| signature |
3 files changed, 18 insertions(+), 14 deletions(-)
lib/std/debug.zig+4| ... | ... | @@ -1335,7 +1335,11 @@ fn dumpSegfaultInfoPosix(sig: i32, code: i32, addr: usize, ctx_ptr: ?*anyopaque) |
| 1335 | 1335 | .x86, |
| 1336 | 1336 | .x86_64, |
| 1337 | 1337 | .arm, |
| 1338 | .armeb, | |
| 1339 | .thumb, | |
| 1340 | .thumbeb, | |
| 1338 | 1341 | .aarch64, |
| 1342 | .aarch64_be, | |
| 1339 | 1343 | => { |
| 1340 | 1344 | const ctx: *posix.ucontext_t = @ptrCast(@alignCast(ctx_ptr)); |
| 1341 | 1345 | dumpStackTraceFromBase(ctx); |
lib/std/debug/Dwarf/abi.zig+9-9| ... | ... | @@ -35,8 +35,8 @@ pub fn ipRegNum(arch: Arch) ?u8 { |
| 35 | 35 | return switch (arch) { |
| 36 | 36 | .x86 => 8, |
| 37 | 37 | .x86_64 => 16, |
| 38 | .arm => 15, | |
| 39 | .aarch64 => 32, | |
| 38 | .arm, .armeb, .thumb, .thumbeb => 15, | |
| 39 | .aarch64, .aarch64_be => 32, | |
| 40 | 40 | else => null, |
| 41 | 41 | }; |
| 42 | 42 | } |
| ... | ... | @@ -47,8 +47,8 @@ pub fn fpRegNum(arch: Arch, reg_context: RegisterContext) u8 { |
| 47 | 47 | // (only in .eh_frame), and that is now the convention for MachO |
| 48 | 48 | .x86 => if (reg_context.eh_frame and reg_context.is_macho) 4 else 5, |
| 49 | 49 | .x86_64 => 6, |
| 50 | .arm => 11, | |
| 51 | .aarch64 => 29, | |
| 50 | .arm, .armeb, .thumb, .thumbeb => 11, | |
| 51 | .aarch64, .aarch64_be => 29, | |
| 52 | 52 | else => unreachable, |
| 53 | 53 | }; |
| 54 | 54 | } |
| ... | ... | @@ -57,8 +57,8 @@ pub fn spRegNum(arch: Arch, reg_context: RegisterContext) u8 { |
| 57 | 57 | return switch (arch) { |
| 58 | 58 | .x86 => if (reg_context.eh_frame and reg_context.is_macho) 5 else 4, |
| 59 | 59 | .x86_64 => 7, |
| 60 | .arm => 13, | |
| 61 | .aarch64 => 31, | |
| 60 | .arm, .armeb, .thumb, .thumbeb => 13, | |
| 61 | .aarch64, .aarch64_be => 31, | |
| 62 | 62 | else => unreachable, |
| 63 | 63 | }; |
| 64 | 64 | } |
| ... | ... | @@ -131,7 +131,7 @@ pub fn regBytes( |
| 131 | 131 | 16 => mem.asBytes(&thread_context_ptr.Rip), |
| 132 | 132 | else => error.InvalidRegister, |
| 133 | 133 | }, |
| 134 | .aarch64 => switch (reg_number) { | |
| 134 | .aarch64, .aarch64_be => switch (reg_number) { | |
| 135 | 135 | 0...30 => mem.asBytes(&thread_context_ptr.DUMMYUNIONNAME.X[reg_number]), |
| 136 | 136 | 31 => mem.asBytes(&thread_context_ptr.Sp), |
| 137 | 137 | 32 => mem.asBytes(&thread_context_ptr.Pc), |
| ... | ... | @@ -269,7 +269,7 @@ pub fn regBytes( |
| 269 | 269 | }, |
| 270 | 270 | else => error.UnimplementedOs, |
| 271 | 271 | }, |
| 272 | .arm => switch (builtin.os.tag) { | |
| 272 | .arm, .armeb, .thumb, .thumbeb => switch (builtin.os.tag) { | |
| 273 | 273 | .linux => switch (reg_number) { |
| 274 | 274 | 0 => mem.asBytes(&ucontext_ptr.mcontext.arm_r0), |
| 275 | 275 | 1 => mem.asBytes(&ucontext_ptr.mcontext.arm_r1), |
| ... | ... | @@ -292,7 +292,7 @@ pub fn regBytes( |
| 292 | 292 | }, |
| 293 | 293 | else => error.UnimplementedOs, |
| 294 | 294 | }, |
| 295 | .aarch64 => switch (builtin.os.tag) { | |
| 295 | .aarch64, .aarch64_be => switch (builtin.os.tag) { | |
| 296 | 296 | .macos, .ios, .watchos => switch (reg_number) { |
| 297 | 297 | 0...28 => mem.asBytes(&ucontext_ptr.mcontext.ss.regs[reg_number]), |
| 298 | 298 | 29 => mem.asBytes(&ucontext_ptr.mcontext.ss.fp), |
lib/std/debug/SelfInfo.zig+5-5| ... | ... | @@ -1419,7 +1419,7 @@ pub fn unwindFrameMachO( |
| 1419 | 1419 | return unwindFrameMachODwarf(context, ma, eh_frame orelse return error.MissingEhFrame, @intCast(encoding.value.x86_64.dwarf)); |
| 1420 | 1420 | }, |
| 1421 | 1421 | }, |
| 1422 | .aarch64 => switch (encoding.mode.arm64) { | |
| 1422 | .aarch64, .aarch64_be => switch (encoding.mode.arm64) { | |
| 1423 | 1423 | .OLD => return error.UnimplementedUnwindEncoding, |
| 1424 | 1424 | .FRAMELESS => blk: { |
| 1425 | 1425 | const sp = (try regValueNative(context.thread_context, spRegNum(reg_context), reg_context)).*; |
| ... | ... | @@ -1535,7 +1535,7 @@ pub const UnwindContext = struct { |
| 1535 | 1535 | /// Some platforms use pointer authentication - the upper bits of instruction pointers contain a signature. |
| 1536 | 1536 | /// This function clears these signature bits to make the pointer usable. |
| 1537 | 1537 | pub inline fn stripInstructionPtrAuthCode(ptr: usize) usize { |
| 1538 | if (native_arch == .aarch64) { | |
| 1538 | if (native_arch.isAARCH64()) { | |
| 1539 | 1539 | // `hint 0x07` maps to `xpaclri` (or `nop` if the hardware doesn't support it) |
| 1540 | 1540 | // The save / restore is because `xpaclri` operates on x30 (LR) |
| 1541 | 1541 | return asm ( |
| ... | ... | @@ -1787,11 +1787,11 @@ pub fn supportsUnwinding(target: std.Target) bool { |
| 1787 | 1787 | .linux, .netbsd, .freebsd, .openbsd, .macos, .ios, .solaris, .illumos => true, |
| 1788 | 1788 | else => false, |
| 1789 | 1789 | }, |
| 1790 | .arm => switch (target.os.tag) { | |
| 1790 | .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { | |
| 1791 | 1791 | .linux => true, |
| 1792 | 1792 | else => false, |
| 1793 | 1793 | }, |
| 1794 | .aarch64 => switch (target.os.tag) { | |
| 1794 | .aarch64, .aarch64_be => switch (target.os.tag) { | |
| 1795 | 1795 | .linux, .netbsd, .freebsd, .macos, .ios => true, |
| 1796 | 1796 | else => false, |
| 1797 | 1797 | }, |
| ... | ... | @@ -2194,7 +2194,7 @@ pub const VirtualMachine = struct { |
| 2194 | 2194 | /// the .undefined rule by default, but allows ABI authors to override that. |
| 2195 | 2195 | fn getRegDefaultValue(reg_number: u8, context: *UnwindContext, out: []u8) !void { |
| 2196 | 2196 | switch (builtin.cpu.arch) { |
| 2197 | .aarch64 => { | |
| 2197 | .aarch64, .aarch64_be => { | |
| 2198 | 2198 | // Callee-saved registers are initialized as if they had the .same_value rule |
| 2199 | 2199 | if (reg_number >= 19 and reg_number <= 28) { |
| 2200 | 2200 | const src = try regBytes(context.thread_context, reg_number, context.reg_context); |