Commit b2d9fbd5 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

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

parent 88457bf6
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment