]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 34052 kill: Terminate inferior with non-zero exit code on Windows
authorLuca Bacci <luca.bacci@outlook.com>
Fri, 10 Apr 2026 11:49:44 +0000 (13:49 +0200)
committerTom Tromey <tromey@adacore.com>
Tue, 14 Apr 2026 15:54:20 +0000 (09:54 -0600)
Don't terminate the inferior with exit code 0 (a 'success' exit
code). Rather, use the standard exit code 137 as with SIGKILL on
Linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34052
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/windows-nat.c
gdbserver/win32-low.cc

index e25ae81f054155879913ba27eee06444960e5f90..964d87c24ef9783bb92fbb14adc729b61c9ed47b 100644 (file)
@@ -2352,7 +2352,7 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
 void
 windows_nat_target::kill ()
 {
-  CHECK (TerminateProcess (windows_process->handle, 0));
+  CHECK (TerminateProcess (windows_process->handle, 137));
 
   for (;;)
     {
index ddc5e5475ecec16ebc2a48a4e5c9f09faf460f34..adb4c08b98036230d9cc835442ac788fb18aeb5b 100644 (file)
@@ -663,7 +663,7 @@ win32_clear_process ()
 int
 win32_process_target::kill (process_info *process)
 {
-  TerminateProcess (windows_process.handle, 0);
+  TerminateProcess (windows_process.handle, 137);
   for (;;)
     {
       if (!child_continue (DBG_CONTINUE, -1))