aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 1ee051b..0c86b57 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2558,6 +2558,9 @@ target_preopen (int from_tty)
void
target_detach (inferior *inf, int from_tty)
{
+ /* Thread's don't need to be resumed until the end of this function. */
+ scoped_disable_commit_resumed disable_commit_resumed ("detaching");
+
/* After we have detached, we will clear the register cache for this inferior
by calling registers_changed_ptid. We must save the pid_ptid before
detaching, as the target detach method will clear inf->pid. */
@@ -2588,6 +2591,8 @@ target_detach (inferior *inf, int from_tty)
inferior_ptid matches save_pid_ptid, but in our case, it does not
call it, as inferior_ptid has been reset. */
reinit_frame_cache ();
+
+ disable_commit_resumed.reset_and_commit ();
}
void