[2/7] Fix latent bug in target_pass_ctrlc

Message ID 20200706190252.22552-3-pedro@palves.net
State New
Headers show
Series
  • GDB busy loop when interrupting non-stop program (PR 26199)
Related show

Commit Message

Pedro Alves July 6, 2020, 7:02 p.m.
We were checking the thr->executing of an exited thread.

gdb/ChangeLog:

	PR gdb/26199
	* target.c (target_pass_ctrlc): Looking at the inferiors
	non-exited threads, not all threads.
---
 gdb/target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.14.5

Patch

diff --git a/gdb/target.c b/gdb/target.c
index f4e4f05b5f..cd66675e8a 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.  */