aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-10-21 20:24:37 -0700
committerGitHub <noreply@github.com>2022-10-21 20:24:37 -0700
commit09236d29b7722d71533478aa7080706acde28d0d (patch)
treed1c5776cf14fc9f579e7fb5ce99de9a015e80eac /lib/std/debug.zig
parentb9103bd514e46a43ab0f3dce397af2ea8a789fda (diff)
parentc36a2c27a51039d486f4149018154687a300d1eb (diff)
downloadzig-09236d29b7722d71533478aa7080706acde28d0d.tar.gz
zig-09236d29b7722d71533478aa7080706acde28d0d.zip
Merge pull request #12837 from topolarity/err-ret-trace-improvements-1923
stage2: Pop error trace frames for handled errors (#1923)
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 93216f0058..21b05249a1 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -411,6 +411,14 @@ pub fn writeStackTrace(
const return_address = stack_trace.instruction_addresses[frame_index];
try printSourceAtAddress(debug_info, out_stream, return_address - 1, tty_config);
}
+
+ if (stack_trace.index > stack_trace.instruction_addresses.len) {
+ const dropped_frames = stack_trace.index - stack_trace.instruction_addresses.len;
+
+ tty_config.setColor(out_stream, .Bold);
+ try out_stream.print("({d} additional stack frames skipped...)\n", .{dropped_frames});
+ tty_config.setColor(out_stream, .Reset);
+ }
}
pub const StackIterator = struct {