aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Moioli <smxdev4@gmail.com>2023-12-06 01:42:19 +0100
committerTom Tromey <tromey@adacore.com>2023-12-12 13:19:30 -0700
commitfa659800b009df1f0bdb0c5d24eec047fb9c3fa0 (patch)
tree5f142b6b11bffbe7aa478c938de8e1dcab0d6fdc
parent80ffe7226459e3edf840d0c23462d93cb560d2de (diff)
downloadgdb-fa659800b009df1f0bdb0c5d24eec047fb9c3fa0.zip
gdb-fa659800b009df1f0bdb0c5d24eec047fb9c3fa0.tar.gz
gdb-fa659800b009df1f0bdb0c5d24eec047fb9c3fa0.tar.bz2
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 <tom@tromey.com>
-rw-r--r--gdbserver/win32-low.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 2711fb3..90d9510 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;
}