aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-08-31 20:57:27 -0700
committerGitHub <noreply@github.com>2024-08-31 20:57:27 -0700
commit96daca7b3b6f02033e68ac91776bf6e8d2b67409 (patch)
tree785d872334a63422cad75dffaa7efa8e59090b7e /lib/std/debug.zig
parent69e304bd510e3fed2d51582edc6f11127824d7e6 (diff)
parent4adb10df4722a020e4db5140c0fd30962a526813 (diff)
downloadzig-96daca7b3b6f02033e68ac91776bf6e8d2b67409.tar.gz
zig-96daca7b3b6f02033e68ac91776bf6e8d2b67409.zip
Merge pull request #21173 from mrjbq7/writeStackTrace
std.debug: remove allocator from std.debug.writeStackTrace()
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index a73c8e9668..554788f4fd 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -377,7 +377,7 @@ pub fn dumpStackTrace(stack_trace: std.builtin.StackTrace) void {
stderr.print("Unable to dump stack trace: Unable to open debug info: {s}\n", .{@errorName(err)}) catch return;
return;
};
- writeStackTrace(stack_trace, stderr, getDebugInfoAllocator(), debug_info, io.tty.detectConfig(io.getStdErr())) catch |err| {
+ writeStackTrace(stack_trace, stderr, debug_info, io.tty.detectConfig(io.getStdErr())) catch |err| {
stderr.print("Unable to dump stack trace: {s}\n", .{@errorName(err)}) catch return;
return;
};
@@ -520,11 +520,9 @@ fn waitForOtherThreadToFinishPanicking() void {
pub fn writeStackTrace(
stack_trace: std.builtin.StackTrace,
out_stream: anytype,
- allocator: mem.Allocator,
debug_info: *SelfInfo,
tty_config: io.tty.Config,
) !void {
- _ = allocator;
if (builtin.strip_debug_info) return error.MissingDebugInfo;
var frame_index: usize = 0;
var frames_left: usize = @min(stack_trace.index, stack_trace.instruction_addresses.len);
@@ -1452,7 +1450,7 @@ pub fn ConfigurableTrace(comptime size: usize, comptime stack_frame_count: usize
.index = frames.len,
.instruction_addresses = frames,
};
- writeStackTrace(stack_trace, stderr, getDebugInfoAllocator(), debug_info, tty_config) catch continue;
+ writeStackTrace(stack_trace, stderr, debug_info, tty_config) catch continue;
}
if (t.index > end) {
stderr.print("{d} more traces not shown; consider increasing trace size\n", .{