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:
parent
88457bf68e
commit
b2d9fbd578
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue