| author | |
| committer | |
| log | 0c24b8ec66e7f8ade2b1014fd5c06110354bcf43 |
| tree | 9ae70804cbe421b79a056746ee6e17e6e2bbe82d |
| parent | 3a9c680ad7b88ed6d9684626be9138ffc44b73b7 |
| signature |
5 files changed, 12 insertions(+), 15 deletions(-)
lib/std/debug/Dwarf/expression.zig+1-4| ... | ... | @@ -1566,10 +1566,7 @@ test "basics" { |
| 1566 | 1566 | |
| 1567 | 1567 | // Register location description |
| 1568 | 1568 | var cpu_context: std.debug.cpu_context.Native = undefined; |
| 1569 | std.debug.relocateContext(&cpu_context); | |
| 1570 | context = Context{ | |
| 1571 | .cpu_context = &cpu_context, | |
| 1572 | }; | |
| 1569 | context = .{ .cpu_context = &cpu_context }; | |
| 1573 | 1570 | |
| 1574 | 1571 | const reg_bytes = try cpu_context.dwarfRegisterBytes(0); |
| 1575 | 1572 | mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian); |
src/crash_report.zig+1-1| ... | ... | @@ -17,7 +17,7 @@ pub const debug = struct { |
| 17 | 17 | /// crash earlier than that. |
| 18 | 18 | pub var zig_argv0: []const u8 = "zig"; |
| 19 | 19 | |
| 20 | fn handleSegfaultImpl(addr: ?usize, name: []const u8, opt_ctx: ?std.debug.ThreadContextPtr) noreturn { | |
| 20 | fn handleSegfaultImpl(addr: ?usize, name: []const u8, opt_ctx: ?std.debug.CpuContextPtr) noreturn { | |
| 21 | 21 | @branchHint(.cold); |
| 22 | 22 | dumpCrashContext() catch {}; |
| 23 | 23 | std.debug.defaultHandleSegfault(addr, name, opt_ctx); |
src/target.zig+1-1| ... | ... | @@ -512,7 +512,7 @@ pub fn defaultUnwindTables(target: *const std.Target, libunwind: bool, libtsan: |
| 512 | 512 | if (target.os.tag.isDarwin()) return .async; |
| 513 | 513 | if (libunwind) return .async; |
| 514 | 514 | if (libtsan) return .async; |
| 515 | if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .async; | |
| 515 | if (std.debug.Dwarf.supportsUnwinding(target)) return .async; | |
| 516 | 516 | return .none; |
| 517 | 517 | } |
| 518 | 518 |
test/standalone/stack_iterator/unwind.zig+5-5| ... | ... | @@ -3,7 +3,7 @@ const builtin = @import("builtin"); |
| 3 | 3 | const fatal = std.process.fatal; |
| 4 | 4 | |
| 5 | 5 | noinline fn frame3(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 6 | expected[0] = @returnAddress(); | |
| 6 | expected[0] = @returnAddress() - 1; | |
| 7 | 7 | return std.debug.captureCurrentStackTrace(.{ |
| 8 | 8 | .first_address = @returnAddress(), |
| 9 | 9 | .allow_unsafe_unwind = true, |
| ... | ... | @@ -58,12 +58,12 @@ noinline fn frame2(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | expected[1] = @returnAddress(); | |
| 61 | expected[1] = @returnAddress() - 1; | |
| 62 | 62 | return frame3(expected, addr_buf); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 66 | expected[2] = @returnAddress(); | |
| 66 | expected[2] = @returnAddress() - 1; | |
| 67 | 67 | |
| 68 | 68 | // Use a stack frame that is too big to encode in __unwind_info's stack-immediate encoding |
| 69 | 69 | // to exercise the stack-indirect encoding path |
| ... | ... | @@ -74,12 +74,12 @@ noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | noinline fn frame0(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 77 | expected[3] = @returnAddress(); | |
| 77 | expected[3] = @returnAddress() - 1; | |
| 78 | 78 | return frame1(expected, addr_buf); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | pub fn main() void { |
| 82 | if (std.posix.ucontext_t == void and builtin.omit_frame_pointer) { | |
| 82 | if (std.debug.cpu_context.Native == noreturn and builtin.omit_frame_pointer) { | |
| 83 | 83 | // Stack unwinding is impossible. |
| 84 | 84 | return; |
| 85 | 85 | } |
test/standalone/stack_iterator/unwind_freestanding.zig+4-4| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | const std = @import("std"); |
| 4 | 4 | |
| 5 | 5 | noinline fn frame3(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 6 | expected[0] = @returnAddress(); | |
| 6 | expected[0] = @returnAddress() - 1; | |
| 7 | 7 | return std.debug.captureCurrentStackTrace(.{ |
| 8 | 8 | .first_address = @returnAddress(), |
| 9 | 9 | .allow_unsafe_unwind = true, |
| ... | ... | @@ -11,12 +11,12 @@ noinline fn frame3(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | noinline fn frame2(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 14 | expected[1] = @returnAddress(); | |
| 14 | expected[1] = @returnAddress() - 1; | |
| 15 | 15 | return frame3(expected, addr_buf); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 19 | expected[2] = @returnAddress(); | |
| 19 | expected[2] = @returnAddress() - 1; | |
| 20 | 20 | |
| 21 | 21 | // Use a stack frame that is too big to encode in __unwind_info's stack-immediate encoding |
| 22 | 22 | // to exercise the stack-indirect encoding path |
| ... | ... | @@ -27,7 +27,7 @@ noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | noinline fn frame0(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace { |
| 30 | expected[3] = @returnAddress(); | |
| 30 | expected[3] = @returnAddress() - 1; | |
| 31 | 31 | return frame1(expected, addr_buf); |
| 32 | 32 | } |
| 33 | 33 |