linux: rework getcontext to closer match the specification (saved IP/SP match the state after it would return)

debug: fixup ucontext_t check
This commit is contained in:
kcbanner
2023-06-27 23:53:05 -04:00
parent 89ef004646
commit caa334712f
3 changed files with 119 additions and 65 deletions

View File

@@ -136,7 +136,7 @@ pub fn dumpCurrentStackTrace(start_addr: ?usize) void {
pub const StackTraceContext = blk: {
if (native_os == .windows) {
break :blk std.os.windows.CONTEXT;
} else if (@hasDecl(os.system, "ucontext_t")) {
} else if (StackIterator.supports_context) {
break :blk os.ucontext_t;
} else {
break :blk void;