[PATCH 3/4] winedbg: Don't set initial thread->name to the tid.
Brendan Shanks
bshanks at codeweavers.com
Wed Feb 23 22:05:48 CST 2022
Currently the name is only used by GDB, send the tid there.
Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
---
programs/winedbg/gdbproxy.c | 9 ++++++++-
programs/winedbg/winedbg.c | 3 +--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 89985c06666..0f6357268b6 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -1790,7 +1790,14 @@ 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=\"");
- reply_buffer_append_str(reply, thread->name);
+ if (strlen(thread->name))
+ reply_buffer_append_str(reply, thread->name);
+ else
+ {
+ char tid[5];
+ snprintf(tid, sizeof(tid), "%04lx", thread->tid);
+ reply_buffer_append_str(reply, tid);
+ }
reply_buffer_append_str(reply, "\"/>");
}
reply_buffer_append_str(reply, "</threads>");
diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c
index 95318eeb2f1..89fb265fc93 100644
--- a/programs/winedbg/winedbg.c
+++ b/programs/winedbg/winedbg.c
@@ -444,6 +444,7 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid,
t->step_over_bp.enabled = FALSE;
t->step_over_bp.refcount = 0;
t->stopped_xpoint = -1;
+ t->name[0] = '\0';
t->in_exception = FALSE;
t->frames = NULL;
t->num_frames = 0;
@@ -451,8 +452,6 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid,
t->addr_mode = AddrModeFlat;
t->suspended = FALSE;
- snprintf(t->name, sizeof(t->name), "%04lx", tid);
-
list_add_head(&p->threads, &t->entry);
return t;
--
2.34.1
More information about the wine-devel
mailing list