Move sys_can_stack_trace from GPA to std.debug so that it can be re-used as needed

This commit is contained in:
Ryan Liptak
2022-06-25 21:27:56 -07:00
parent 19d7f4dd82
commit 22720981ea
3 changed files with 25 additions and 22 deletions

View File

@@ -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,