diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-10-21 04:40:44 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:50 -0700 |
| commit | aadd8d4a3efd8912c47b8ea1bbd4c3a6649c3e5d (patch) | |
| tree | 9b6e2b59f28bd736c70a103fb063a55e3ddafef9 /lib/std/debug.zig | |
| parent | 4ed74a9f8ab97f3358fc881d0e2f6359e22186d6 (diff) | |
| download | zig-aadd8d4a3efd8912c47b8ea1bbd4c3a6649c3e5d.tar.gz zig-aadd8d4a3efd8912c47b8ea1bbd4c3a6649c3e5d.zip | |
std: back out the StackTrace byval changes
Let's keep passing this thing by pointer
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 3d88123c64..a92a4b360f 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -553,7 +553,7 @@ pub fn defaultPanic( if (@errorReturnTrace()) |t| if (t.index > 0) { stderr.writeAll("error return context:\n") catch break :trace; - writeStackTrace(t.*, stderr, tty_config) catch break :trace; + writeStackTrace(t, stderr, tty_config) catch break :trace; stderr.writeAll("\nstack trace:\n") catch break :trace; }; writeCurrentStackTrace(.{ @@ -765,12 +765,12 @@ pub const FormatStackTrace = struct { pub fn format(context: @This(), writer: *Io.Writer) Io.Writer.Error!void { try writer.writeAll("\n"); - try writeStackTrace(context.stack_trace, writer, context.tty_config); + try writeStackTrace(&context.stack_trace, writer, context.tty_config); } }; /// Write a previously captured stack trace to `writer`, annotated with source locations. -pub fn writeStackTrace(st: StackTrace, writer: *Writer, tty_config: tty.Config) Writer.Error!void { +pub fn writeStackTrace(st: *const StackTrace, writer: *Writer, tty_config: tty.Config) Writer.Error!void { if (!std.options.allow_stack_tracing) { tty_config.setColor(writer, .dim) catch {}; try writer.print("Cannot print stack trace: stack tracing is disabled\n", .{}); @@ -808,7 +808,7 @@ pub fn writeStackTrace(st: StackTrace, writer: *Writer, tty_config: tty.Config) } } /// A thin wrapper around `writeStackTrace` which writes to stderr and ignores write errors. -pub fn dumpStackTrace(st: StackTrace) void { +pub fn dumpStackTrace(st: *const StackTrace) void { const tty_config = tty.detectConfig(.stderr()); const stderr = lockStderrWriter(&.{}); defer unlockStderrWriter(); @@ -1686,7 +1686,7 @@ pub fn ConfigurableTrace(comptime size: usize, comptime stack_frame_count: usize .index = frames.len, .instruction_addresses = frames, }; - writeStackTrace(stack_trace, stderr, tty_config) catch return; + writeStackTrace(&stack_trace, stderr, tty_config) catch return; } if (t.index > end) { stderr.print("{d} more traces not shown; consider increasing trace size\n", .{ |
