From: Eric Pouech <epouech@codeweavers.com> When attached to a minidump, only dump threads from the minidump. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- programs/winedbg/info.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c index e1bb33bad53..feeaf42fdfb 100644 --- a/programs/winedbg/info.c +++ b/programs/winedbg/info.c @@ -676,7 +676,7 @@ static BOOL get_process_name(DWORD pid, PROCESSENTRY32W* entry) return ret; } -void info_win32_threads(void) +static void info_win32_active_threads(void) { HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); if (snap != INVALID_HANDLE_VALUE) @@ -732,6 +732,34 @@ void info_win32_threads(void) } } +void info_win32_threads(void) +{ + if (!dbg_curr_process || dbg_curr_process->active_debuggee) + info_win32_active_threads(); + else + { + struct dbg_process *pcs; + struct dbg_thread *thread; + WCHAR *description; + + dbg_printf("%-8.8s %-8.8s %s %s (all IDs are in hex)\n", + "process", "tid", "prio", "name"); + LIST_FOR_EACH_ENTRY(pcs, &dbg_process_list, struct dbg_process, entry) + { + dbg_printf("%08lx%s %ls\n", pcs->pid, " (D)", pcs->imageName); + LIST_FOR_EACH_ENTRY(thread, &pcs->threads, struct dbg_thread, entry) + { + description = dbg_fetch_thread_name(thread); + /* FIXME thread prio is available from a minidump */ + dbg_printf("\t%08lx %4s%s %ls\n", + thread->tid, "?", (thread->tid == dbg_curr_tid) ? " <==" : " ", + description ? description : L""); + free(description); + } + } + } +} + /*********************************************************************** * info_win32_frame_exceptions * -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10562