authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-09-17 23:30:04+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-09-30 13:44:55+01:00
logabb2b1e2daffdadca7edc26634631215df901950
treec7005ecca97db608bba384dbdc43fc56c24eb8a2
parentdd8d59686a069fdb72d9f0753e3482ff99cce98c
signaturelock-open Commit is signed but in an unrecognized format.

std.debug: update support checks


1 files changed, 7 insertions(+), 12 deletions(-)

lib/std/debug.zig+7-12
......@@ -175,18 +175,12 @@ pub const runtime_safety = switch (builtin.mode) {
175175 .ReleaseFast, .ReleaseSmall => false,
176176};
177177
178/// Whether we can unwind the stack on this target, allowing capturing and/or printing the current
179/// stack trace. It is still legal to call `captureCurrentStackTrace`, `writeCurrentStackTrace`, and
180/// `dumpCurrentStackTrace` if this is `false`; it will just print an error / capture an empty
181/// trace due to missing functionality. This value is just intended as a heuristic to avoid
182/// pointless work e.g. capturing always-empty stack traces.
178183pub const sys_can_stack_trace = switch (builtin.cpu.arch) {
179 // Observed to go into an infinite loop.
180 // TODO: Make this work.
181 .loongarch32,
182 .loongarch64,
183 .mips,
184 .mipsel,
185 .mips64,
186 .mips64el,
187 .s390x,
188 => false,
189
190184 // `@returnAddress()` in LLVM 10 gives
191185 // "Non-Emscripten WebAssembly hasn't implemented __builtin_return_address".
192186 // On Emscripten, Zig only supports `@returnAddress()` in debug builds
......@@ -1178,9 +1172,10 @@ pub const have_segfault_handling_support = switch (native_os) {
11781172 .solaris,
11791173 .illumos,
11801174 .windows,
1175 .freebsd,
1176 .openbsd,
11811177 => true,
11821178
1183 .freebsd, .openbsd => cpu_context.Native != noreturn,
11841179 else => false,
11851180};
11861181