Signed-off-by: Brendan Shanks bshanks@codeweavers.com ---
v2: Use the fetch_thread_description() previously added to info.c.
programs/winedbg/gdbproxy.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index e9f3875db2d..eb1246c5912 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -1773,6 +1773,7 @@ static enum packet_return packet_query_threads(struct gdb_context* gdbctx) struct reply_buffer* reply = &gdbctx->qxfer_buffer; struct dbg_process* process = gdbctx->process; struct dbg_thread* thread; + WCHAR* description;
if (!process) return packet_error;
@@ -1786,7 +1787,19 @@ static enum packet_return packet_query_threads(struct gdb_context* gdbctx) reply_buffer_append_str(reply, "id=""); reply_buffer_append_uinthex(reply, thread->tid, 4); reply_buffer_append_str(reply, "" name=""); - if (strlen(thread->name)) + if ((description = fetch_thread_description(thread->tid))) + { + char* name; + int len; + + len = WideCharToMultiByte(CP_ACP, 0, description, -1, NULL, 0, NULL, NULL); + name = HeapAlloc(GetProcessHeap(), 0, len); + if (WideCharToMultiByte(CP_ACP, 0, description, -1, name, len, NULL, NULL)) + reply_buffer_append_str(reply, name); + HeapFree(GetProcessHeap(), 0, name); + LocalFree(description); + } + else if (strlen(thread->name)) { reply_buffer_append_str(reply, thread->name); }