authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-09-18 00:03:03+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-09-30 13:44:55+01:00
log0c24b8ec66e7f8ade2b1014fd5c06110354bcf43
tree9ae70804cbe421b79a056746ee6e17e6e2bbe82d
parent3a9c680ad7b88ed6d9684626be9138ffc44b73b7
signaturelock-open Commit is signed but in an unrecognized format.

update to new std.debug changes


5 files changed, 12 insertions(+), 15 deletions(-)

lib/std/debug/Dwarf/expression.zig+1-4
......@@ -1566,10 +1566,7 @@ test "basics" {
15661566
15671567 // Register location description
15681568 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 };
15731570
15741571 const reg_bytes = try cpu_context.dwarfRegisterBytes(0);
15751572 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 {
1717/// crash earlier than that.
1818pub var zig_argv0: []const u8 = "zig";
1919
20fn handleSegfaultImpl(addr: ?usize, name: []const u8, opt_ctx: ?std.debug.ThreadContextPtr) noreturn {
20fn handleSegfaultImpl(addr: ?usize, name: []const u8, opt_ctx: ?std.debug.CpuContextPtr) noreturn {
2121 @branchHint(.cold);
2222 dumpCrashContext() catch {};
2323 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:
512512 if (target.os.tag.isDarwin()) return .async;
513513 if (libunwind) return .async;
514514 if (libtsan) return .async;
515 if (std.debug.Dwarf.abi.supportsUnwinding(target)) return .async;
515 if (std.debug.Dwarf.supportsUnwinding(target)) return .async;
516516 return .none;
517517}
518518
test/standalone/stack_iterator/unwind.zig+5-5
......@@ -3,7 +3,7 @@ const builtin = @import("builtin");
33const fatal = std.process.fatal;
44
55noinline fn frame3(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
6 expected[0] = @returnAddress();
6 expected[0] = @returnAddress() - 1;
77 return std.debug.captureCurrentStackTrace(.{
88 .first_address = @returnAddress(),
99 .allow_unsafe_unwind = true,
......@@ -58,12 +58,12 @@ noinline fn frame2(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr
5858 }
5959 }
6060
61 expected[1] = @returnAddress();
61 expected[1] = @returnAddress() - 1;
6262 return frame3(expected, addr_buf);
6363}
6464
6565noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
66 expected[2] = @returnAddress();
66 expected[2] = @returnAddress() - 1;
6767
6868 // Use a stack frame that is too big to encode in __unwind_info's stack-immediate encoding
6969 // to exercise the stack-indirect encoding path
......@@ -74,12 +74,12 @@ noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr
7474}
7575
7676noinline fn frame0(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
77 expected[3] = @returnAddress();
77 expected[3] = @returnAddress() - 1;
7878 return frame1(expected, addr_buf);
7979}
8080
8181pub 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) {
8383 // Stack unwinding is impossible.
8484 return;
8585 }
test/standalone/stack_iterator/unwind_freestanding.zig+4-4
......@@ -3,7 +3,7 @@
33const std = @import("std");
44
55noinline fn frame3(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
6 expected[0] = @returnAddress();
6 expected[0] = @returnAddress() - 1;
77 return std.debug.captureCurrentStackTrace(.{
88 .first_address = @returnAddress(),
99 .allow_unsafe_unwind = true,
......@@ -11,12 +11,12 @@ noinline fn frame3(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr
1111}
1212
1313noinline fn frame2(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
14 expected[1] = @returnAddress();
14 expected[1] = @returnAddress() - 1;
1515 return frame3(expected, addr_buf);
1616}
1717
1818noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
19 expected[2] = @returnAddress();
19 expected[2] = @returnAddress() - 1;
2020
2121 // Use a stack frame that is too big to encode in __unwind_info's stack-immediate encoding
2222 // to exercise the stack-indirect encoding path
......@@ -27,7 +27,7 @@ noinline fn frame1(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTr
2727}
2828
2929noinline fn frame0(expected: *[4]usize, addr_buf: *[4]usize) std.builtin.StackTrace {
30 expected[3] = @returnAddress();
30 expected[3] = @returnAddress() - 1;
3131 return frame1(expected, addr_buf);
3232}
3333