aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 0c86b57..0eae530 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -908,6 +908,15 @@ add_deprecated_target_alias (const target_info &tinfo, const char *alias)
void
target_kill (void)
{
+
+ /* If the commit_resume_state of the to-be-killed-inferior's process stratum
+ is true, and this inferior is the last live inferior with resumed threads
+ of that target, then we want to leave commit_resume_state to false, as the
+ target won't have any resumed threads anymore. We achieve this with
+ this scoped_disable_commit_resumed. On construction, it will set the flag
+ to false. On destruction, it will only set it to true if there are resumed
+ threads left. */
+ scoped_disable_commit_resumed disable ("killing");
current_inferior ()->top_target ()->kill ();
}