| author | |
| committer | |
| log | dae703d3c028eab3bf98d89d2bca1abc75f864fa |
| tree | 4bd94cfc89a12966a4d585f1c2da73ec861c6a8b |
| parent | 2ab650b4817cbb22244c17de828e82cbb0ccf15e |
| signature |
Processes should reasonably be able to expect their children to abort
with typical exit codes, rather than a debugger breakpoint signal. This
flag in the PEB is what would be checked by `IsDebuggerPresent` in
kernel32, which is the function you would typically use for this
purpose.
This fixes `test-stack-trace` failures on Windows, as these tests were
expecting exit code 3 to indicate abort.1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/posix.zig+1-1| ... | ... | @@ -689,7 +689,7 @@ pub fn abort() noreturn { |
| 689 | 689 | // even when linking libc on Windows we use our own abort implementation. |
| 690 | 690 | // See https://github.com/ziglang/zig/issues/2071 for more details. |
| 691 | 691 | if (native_os == .windows) { |
| 692 | if (builtin.mode == .Debug) { | |
| 692 | if (builtin.mode == .Debug and windows.peb().BeingDebugged != 0) { | |
| 693 | 693 | @breakpoint(); |
| 694 | 694 | } |
| 695 | 695 | windows.kernel32.ExitProcess(3); |