aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-01-11 18:52:12 +0000
committerPedro Alves <pedro@palves.net>2021-01-12 22:52:56 +0000
commit0dc1231a90acb5068a23d399f29143f8833915eb (patch)
tree276972e9470a6be58aea2efd5b3a95b139bd8f4b
parentf49e903aaede19996e81cc4438e26f70eea504bc (diff)
downloadbinutils-0dc1231a90acb5068a23d399f29143f8833915eb.zip
binutils-0dc1231a90acb5068a23d399f29143f8833915eb.tar.gz
binutils-0dc1231a90acb5068a23d399f29143f8833915eb.tar.bz2
prepare_for_detach: don't release scoped_restore at the end
After detaching from a process, the inf->detaching flag is inadvertently left set to true. If you afterwards reuse the same inferior to start a new process, GDB will mishave... The problem is that prepare_for_detach discards the scoped_restore at the end, while the intention is for the flag to be set only for the duration of prepare_for_detach. This was already a bug in the original commit that added prepare_for_detach, commit 24291992dac3 ("PR gdb/11321"), by yours truly. Back then, we still used cleanups, and the function called discard_cleanups instead of do_cleanups, by mistake. gdb/ChangeLog: * infrun.c (prepare_for_detach): Don't release scoped_restore at the end.
-rw-r--r--gdb/infrun.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index b62e74d..fc7ba74 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3612,8 +3612,6 @@ prepare_for_detach (void)
error (_("Program exited while detaching"));
}
}
-
- restore_detaching.release ();
}
/* Wait for control to return from inferior to debugger.