From 43667cc6f65e60e2c15f3bb84e45730b537db5fa Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sat, 4 Jul 2020 19:12:30 +0100 Subject: [PATCH] Fix latent bug in target_pass_ctrlc We were checking the thr->executing of an exited thread. gdb/ChangeLog: PR gdb/26199 * target.c (target_pass_ctrlc): Look at the inferior's non-exited threads, not all threads. --- gdb/ChangeLog | 6 ++++++ gdb/target.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b90e45581d3..679f2d25182 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-07-10 Pedro Alves + + PR gdb/26199 + * target.c (target_pass_ctrlc): Look at the inferior's non-exited + threads, not all threads. + 2020-07-10 Pedro Alves PR gdb/26199 diff --git a/gdb/target.c b/gdb/target.c index f4e4f05b5fa..cd66675e8a4 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3274,7 +3274,7 @@ target_pass_ctrlc (void) if (proc_target == NULL) continue; - for (thread_info *thr : inf->threads ()) + for (thread_info *thr : inf->non_exited_threads ()) { /* A thread can be THREAD_STOPPED and executing, while running an infcall. */ -- 2.30.2