winedbg: Print thread names in 'info thread' listing.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2022-02-24 10:34:05 -08:00 committed by Alexandre Julliard
parent 88457bf68e
commit b2d9fbd578
1 changed files with 9 additions and 5 deletions

View File

@ -589,12 +589,14 @@ void info_win32_threads(void)
THREADENTRY32 entry;
BOOL ok;
DWORD lastProcessId = 0;
struct dbg_process* p = NULL;
struct dbg_thread* t = NULL;
entry.dwSize = sizeof(entry);
ok = Thread32First(snap, &entry);
dbg_printf("%-8.8s %-8.8s %s (all id:s are in hex)\n",
"process", "tid", "prio");
dbg_printf("%-8.8s %-8.8s %s %s (all IDs are in hex)\n",
"process", "tid", "prio", "name");
while (ok)
{
if (entry.th32OwnerProcessID != GetCurrentProcessId())
@ -605,10 +607,10 @@ void info_win32_threads(void)
*/
if (entry.th32OwnerProcessID != lastProcessId)
{
struct dbg_process* p = dbg_get_process(entry.th32OwnerProcessID);
PROCESSENTRY32 pcs_entry;
const char* exename;
p = dbg_get_process(entry.th32OwnerProcessID);
if (p)
exename = dbg_W2A(p->imageName, -1);
else if (get_process_name(entry.th32OwnerProcessID, &pcs_entry))
@ -620,9 +622,11 @@ void info_win32_threads(void)
entry.th32OwnerProcessID, p ? " (D)" : "", exename);
lastProcessId = entry.th32OwnerProcessID;
}
dbg_printf("\t%08lx %4ld%s\n",
t = dbg_get_thread(p, entry.th32ThreadID);
dbg_printf("\t%08lx %4ld%s %s\n",
entry.th32ThreadID, entry.tpBasePri,
(entry.th32ThreadID == dbg_curr_tid) ? " <==" : "");
(entry.th32ThreadID == dbg_curr_tid) ? " <==" : " ",
t ? t->name : "");
}
ok = Thread32Next(snap, &entry);