| ... | @@ -8,13 +8,13 @@ pub fn main() !void { | ... | @@ -8,13 +8,13 @@ pub fn main() !void { |
| 8 | var stdout = std.Io.File.stdout().writer(std.Options.debug_io, &buf); | 8 | var stdout = std.Io.File.stdout().writer(std.Options.debug_io, &buf); |
| 9 | | 9 | |
| 10 | const captured_st = try foo(&stdout.interface, &st_buf); | 10 | const captured_st = try foo(&stdout.interface, &st_buf); |
| 11 | try std.debug.writeStackTrace(&captured_st, &stdout.interface, .no_color); | 11 | try std.debug.writeStackTrace(&captured_st, .{ .writer = &stdout.interface, .mode = .no_color }); |
| 12 | try stdout.interface.print("stack trace index: {d}\n", .{captured_st.index}); | 12 | try stdout.interface.print("stack trace index: {d}\n", .{captured_st.index}); |
| 13 | | 13 | |
| 14 | try stdout.interface.flush(); | 14 | try stdout.interface.flush(); |
| 15 | } | 15 | } |
| 16 | fn foo(w: *std.Io.Writer, st_buf: []usize) !std.builtin.StackTrace { | 16 | fn foo(w: *std.Io.Writer, st_buf: []usize) !std.builtin.StackTrace { |
| 17 | try std.debug.writeCurrentStackTrace(.{}, w, .no_color); | 17 | try std.debug.writeCurrentStackTrace(.{}, .{ .writer = w, .mode = .no_color }); |
| 18 | return std.debug.captureCurrentStackTrace(.{}, st_buf); | 18 | return std.debug.captureCurrentStackTrace(.{}, st_buf); |
| 19 | } | 19 | } |
| 20 | | 20 | |