From 1f9d9e321ca0416d970a8a4ae94df69de0e22d14 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 21 Apr 2022 15:09:17 +0100 Subject: gdb: add some additional thread status debug output While working on this patch: https://sourceware.org/pipermail/gdb-patches/2022-January/185109.html I found it really useful to print the executing/resumed status of all threads (or all threads in a particular inferior) at various places (e.g. when a new inferior is started, when GDB attaches, etc). This debug was originally part of the above patch, but I wanted to rewrite this as a separate patch and move the code into a new function in infrun.h, which is what this patch does. Unless 'set debug infrun on' is in effect, then there should be no user visible changes after this commit. --- gdb/infrun.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/infrun.c') diff --git a/gdb/infrun.c b/gdb/infrun.c index 531d398..02c98b5 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -5063,6 +5063,9 @@ stop_all_threads (const char *reason, inferior *inf) INFRUN_SCOPED_DEBUG_START_END ("reason=%s, inf=%d", reason, inf != nullptr ? inf->num : -1); + infrun_debug_show_threads ("non-exited threads", + all_non_exited_threads ()); + scoped_restore_current_thread restore_thread; /* Enable thread events on relevant targets. */ -- cgit v1.1