From 58e558822a2980bcaf29ce2a07474093702cabc6 Mon Sep 17 00:00:00 2001 From: kcbanner Date: Sun, 8 Jan 2023 23:51:55 -0500 Subject: [PATCH] windows: unexpectedStatus/unexpectedError start the stack trace at the caller --- lib/std/os/windows.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 29dda9e8aa..b38a7f73a7 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -2077,7 +2077,7 @@ pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError { ); _ = std.unicode.utf16leToUtf8(&buf_utf8, buf_wstr[0..len]) catch unreachable; std.debug.print("error.Unexpected: GetLastError({}): {s}\n", .{ @enumToInt(err), buf_utf8[0..len] }); - std.debug.dumpCurrentStackTrace(null); + std.debug.dumpCurrentStackTrace(@returnAddress()); } return error.Unexpected; } @@ -2091,7 +2091,7 @@ pub fn unexpectedWSAError(err: ws2_32.WinsockError) std.os.UnexpectedError { pub fn unexpectedStatus(status: NTSTATUS) std.os.UnexpectedError { if (std.os.unexpected_error_tracing) { std.debug.print("error.Unexpected NTSTATUS=0x{x}\n", .{@enumToInt(status)}); - std.debug.dumpCurrentStackTrace(null); + std.debug.dumpCurrentStackTrace(@returnAddress()); } return error.Unexpected; }