Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f89c8be8
Commit
f89c8be8
authored
Feb 24, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Jul 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Prefer thread name from GetThreadDescription() in 'info thread' listing.
parent
546638a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
4 deletions
+47
-4
debugger.h
programs/winedbg/debugger.h
+1
-0
info.c
programs/winedbg/info.c
+46
-4
No files found.
programs/winedbg/debugger.h
View file @
f89c8be8
...
@@ -385,6 +385,7 @@ extern void info_win32_virtual(DWORD pid);
...
@@ -385,6 +385,7 @@ extern void info_win32_virtual(DWORD pid);
extern
void
info_win32_segments
(
DWORD
start
,
int
length
);
extern
void
info_win32_segments
(
DWORD
start
,
int
length
);
extern
void
info_win32_exception
(
void
);
extern
void
info_win32_exception
(
void
);
extern
void
info_wine_dbg_channel
(
BOOL
add
,
const
char
*
chnl
,
const
char
*
name
);
extern
void
info_wine_dbg_channel
(
BOOL
add
,
const
char
*
chnl
,
const
char
*
name
);
extern
WCHAR
*
fetch_thread_description
(
DWORD
tid
);
/* memory.c */
/* memory.c */
extern
BOOL
memory_read_value
(
const
struct
dbg_lvalue
*
lvalue
,
DWORD
size
,
void
*
result
);
extern
BOOL
memory_read_value
(
const
struct
dbg_lvalue
*
lvalue
,
DWORD
size
,
void
*
result
);
...
...
programs/winedbg/info.c
View file @
f89c8be8
...
@@ -595,6 +595,39 @@ static BOOL get_process_name(DWORD pid, PROCESSENTRY32W* entry)
...
@@ -595,6 +595,39 @@ static BOOL get_process_name(DWORD pid, PROCESSENTRY32W* entry)
return
ret
;
return
ret
;
}
}
WCHAR
*
fetch_thread_description
(
DWORD
tid
)
{
static
HRESULT
(
WINAPI
*
my_GetThreadDescription
)(
HANDLE
,
PWSTR
*
)
=
NULL
;
static
BOOL
resolved
=
FALSE
;
HANDLE
h
;
WCHAR
*
desc
=
NULL
;
if
(
!
resolved
)
{
HMODULE
kernelbase
=
GetModuleHandleA
(
"kernelbase.dll"
);
if
(
kernelbase
)
my_GetThreadDescription
=
(
void
*
)
GetProcAddress
(
kernelbase
,
"GetThreadDescription"
);
resolved
=
TRUE
;
}
if
(
!
my_GetThreadDescription
)
return
NULL
;
h
=
OpenThread
(
THREAD_QUERY_LIMITED_INFORMATION
,
FALSE
,
tid
);
if
(
!
h
)
return
NULL
;
my_GetThreadDescription
(
h
,
&
desc
);
CloseHandle
(
h
);
if
(
desc
&&
desc
[
0
]
==
'\0'
)
{
LocalFree
(
desc
);
return
NULL
;
}
return
desc
;
}
void
info_win32_threads
(
void
)
void
info_win32_threads
(
void
)
{
{
HANDLE
snap
=
CreateToolhelp32Snapshot
(
TH32CS_SNAPTHREAD
,
0
);
HANDLE
snap
=
CreateToolhelp32Snapshot
(
TH32CS_SNAPTHREAD
,
0
);
...
@@ -605,6 +638,7 @@ void info_win32_threads(void)
...
@@ -605,6 +638,7 @@ void info_win32_threads(void)
DWORD
lastProcessId
=
0
;
DWORD
lastProcessId
=
0
;
struct
dbg_process
*
p
=
NULL
;
struct
dbg_process
*
p
=
NULL
;
struct
dbg_thread
*
t
=
NULL
;
struct
dbg_thread
*
t
=
NULL
;
WCHAR
*
description
;
entry
.
dwSize
=
sizeof
(
entry
);
entry
.
dwSize
=
sizeof
(
entry
);
ok
=
Thread32First
(
snap
,
&
entry
);
ok
=
Thread32First
(
snap
,
&
entry
);
...
@@ -636,12 +670,20 @@ void info_win32_threads(void)
...
@@ -636,12 +670,20 @@ void info_win32_threads(void)
entry
.
th32OwnerProcessID
,
p
?
" (D)"
:
""
,
exename
);
entry
.
th32OwnerProcessID
,
p
?
" (D)"
:
""
,
exename
);
lastProcessId
=
entry
.
th32OwnerProcessID
;
lastProcessId
=
entry
.
th32OwnerProcessID
;
}
}
t
=
dbg_get_thread
(
p
,
entry
.
th32ThreadID
);
dbg_printf
(
"
\t
%08lx %4ld%s "
,
dbg_printf
(
"
\t
%08lx %4ld%s %s
\n
"
,
entry
.
th32ThreadID
,
entry
.
tpBasePri
,
entry
.
th32ThreadID
,
entry
.
tpBasePri
,
(
entry
.
th32ThreadID
==
dbg_curr_tid
)
?
" <=="
:
" "
,
(
entry
.
th32ThreadID
==
dbg_curr_tid
)
?
" <=="
:
" "
);
t
?
t
->
name
:
""
);
if
((
description
=
fetch_thread_description
(
entry
.
th32ThreadID
)))
{
dbg_printf
(
"%ls
\n
"
,
description
);
LocalFree
(
description
);
}
else
{
t
=
dbg_get_thread
(
p
,
entry
.
th32ThreadID
);
dbg_printf
(
"%s
\n
"
,
t
?
t
->
name
:
""
);
}
}
}
ok
=
Thread32Next
(
snap
,
&
entry
);
ok
=
Thread32Next
(
snap
,
&
entry
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment