diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2022-06-25 21:27:56 -0700 |
|---|---|---|
| committer | Ryan Liptak <squeek502@hotmail.com> | 2022-06-25 21:27:56 -0700 |
| commit | 22720981ea50b1cee38d8309e0cd32df401b8156 (patch) | |
| tree | c2fd4b33cdaff492f4e938d2ffa0bf0fd2bcc7e2 /lib/std/debug.zig | |
| parent | 19d7f4dd8221fcd36b7fb71067bf676bb294ca1c (diff) | |
| download | zig-22720981ea50b1cee38d8309e0cd32df401b8156.tar.gz zig-22720981ea50b1cee38d8309e0cd32df401b8156.zip | |
Move sys_can_stack_trace from GPA to std.debug so that it can be re-used as needed
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 ba1f509e6c..9401bca257 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, |
