Commit 88457bf6 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

winedbg: Don't set initial thread->name to the tid.

Currently the name is only used by GDB, send the tid there. Signed-off-by: 's avatarBrendan Shanks <bshanks@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3c2c4437
...@@ -1790,7 +1790,16 @@ static enum packet_return packet_query_threads(struct gdb_context* gdbctx) ...@@ -1790,7 +1790,16 @@ static enum packet_return packet_query_threads(struct gdb_context* gdbctx)
reply_buffer_append_str(reply, "id=\""); reply_buffer_append_str(reply, "id=\"");
reply_buffer_append_uinthex(reply, thread->tid, 4); reply_buffer_append_uinthex(reply, thread->tid, 4);
reply_buffer_append_str(reply, "\" name=\""); 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, "\"/>");
} }
reply_buffer_append_str(reply, "</threads>"); reply_buffer_append_str(reply, "</threads>");
......
...@@ -444,6 +444,7 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid, ...@@ -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.enabled = FALSE;
t->step_over_bp.refcount = 0; t->step_over_bp.refcount = 0;
t->stopped_xpoint = -1; t->stopped_xpoint = -1;
t->name[0] = '\0';
t->in_exception = FALSE; t->in_exception = FALSE;
t->frames = NULL; t->frames = NULL;
t->num_frames = 0; t->num_frames = 0;
...@@ -451,8 +452,6 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid, ...@@ -451,8 +452,6 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid,
t->addr_mode = AddrModeFlat; t->addr_mode = AddrModeFlat;
t->suspended = FALSE; t->suspended = FALSE;
snprintf(t->name, sizeof(t->name), "%04lx", tid);
list_add_head(&p->threads, &t->entry); list_add_head(&p->threads, &t->entry);
return t; return t;
......
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