diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-09-08 12:52:00 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-09-30 13:44:51 +0100 |
| commit | 202aeacc05a2fc53762c49d18daeefdf0fa5fbec (patch) | |
| tree | 838955ffcb20ba01523ba1f997f7f23b94708ec6 /lib/std/Build/Step.zig | |
| parent | f1215adedab23535024a28367375a62909de6395 (diff) | |
| download | zig-202aeacc05a2fc53762c49d18daeefdf0fa5fbec.tar.gz zig-202aeacc05a2fc53762c49d18daeefdf0fa5fbec.zip | |
std: fixes
Diffstat (limited to 'lib/std/Build/Step.zig')
| -rw-r--r-- | lib/std/Build/Step.zig | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/std/Build/Step.zig b/lib/std/Build/Step.zig index f71a24f2e9..8e9e12248a 100644 --- a/lib/std/Build/Step.zig +++ b/lib/std/Build/Step.zig @@ -275,18 +275,6 @@ pub fn dependOn(step: *Step, other: *Step) void { step.dependencies.append(other) catch @panic("OOM"); } -pub fn getStackTrace(s: *Step) ?std.builtin.StackTrace { - var len: usize = 0; - while (len < s.debug_stack_trace.len and s.debug_stack_trace[len] != 0) { - len += 1; - } - - return if (len == 0) null else .{ - .instruction_addresses = s.debug_stack_trace, - .index = len, - }; -} - fn makeNoOp(step: *Step, options: MakeOptions) anyerror!void { _ = options; @@ -308,9 +296,9 @@ pub fn cast(step: *Step, comptime T: type) ?*T { /// For debugging purposes, prints identifying information about this Step. pub fn dump(step: *Step, w: *std.Io.Writer, tty_config: std.Io.tty.Config) void { - if (step.getStackTrace()) |stack_trace| { + if (step.debug_stack_trace.instruction_addresses.len > 0) { w.print("name: '{s}'. creation stack trace:\n", .{step.name}) catch {}; - std.debug.writeStackTrace(stack_trace, w, tty_config) catch {}; + std.debug.writeStackTrace(&step.debug_stack_trace, w, tty_config) catch {}; } else { const field = "debug_stack_frames_count"; comptime assert(@hasField(Build, field)); |
