From fa659800b009df1f0bdb0c5d24eec047fb9c3fa0 Mon Sep 17 00:00:00 2001 From: Stefano Moioli Date: Wed, 6 Dec 2023 01:42:19 +0100 Subject: [PATCH] gdbserver/win32: fix crash on detach this patch fixes a crash in gdbserver whenever a process is detached. the crash is caused by `detach` calling `remove_process` before `win32_clear_inferiors` error message: Detaching from process 184 ../../gdbserver/inferiors.cc:160: A problem internal to GDBserver has been detec ted. remove_process: Assertion `find_thread_process (process) == NULL' failed. This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Approved-By: Tom Tromey --- gdbserver/win32-low.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 2711fb335f6..90d9510c7b9 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -734,9 +734,9 @@ win32_process_target::detach (process_info *process) return -1; DebugSetProcessKillOnExit (FALSE); + win32_clear_inferiors (); remove_process (process); - win32_clear_inferiors (); return 0; } -- 2.39.5