diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-06-28 14:44:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-28 14:44:00 -0400 |
| commit | 8974cee5a1f67db42a83a0907d8b9e842b979072 (patch) | |
| tree | 449a2d43b19eacf1f2535799f085195367adf548 /lib/std/debug.zig | |
| parent | 9e8298b864e076221ca9c487412209d8a08c43b2 (diff) | |
| parent | 22720981ea50b1cee38d8309e0cd32df401b8156 (diff) | |
| download | zig-8974cee5a1f67db42a83a0907d8b9e842b979072.tar.gz zig-8974cee5a1f67db42a83a0907d8b9e842b979072.zip | |
Merge pull request #11919 from squeek502/failing-allocator-stacktrace
Add stack trace capturing to `FailingAllocator` and use it to improve `checkAllAllocationFailures`
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 54c614f270..b406fed471 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -26,6 +26,27 @@ pub const runtime_safety = switch (builtin.mode) { .ReleaseFast, .ReleaseSmall => false, }; +pub const sys_can_stack_trace = switch (builtin.cpu.arch) { + // Observed to go into an infinite loop. + // TODO: Make this work. + .mips, + .mipsel, + => false, + + // `@returnAddress()` in LLVM 10 gives + // "Non-Emscripten WebAssembly hasn't implemented __builtin_return_address". + .wasm32, + .wasm64, + => builtin.os.tag == .emscripten, + + // `@returnAddress()` is unsupported in LLVM 13. + .bpfel, + .bpfeb, + => false, + + else => true, +}; + pub const LineInfo = struct { line: u64, column: u64, |
