winedbg: Support qXfer:threads:read request.
As we don't report fork/vfork/exec events, this allows gdb to request the list of known threads. Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1e815b372a
commit
c2a381fbed
|
@ -1522,6 +1522,24 @@ static void packet_query_libraries(struct gdb_context* gdbctx)
|
||||||
packet_reply_add(gdbctx, "</library-list>");
|
packet_reply_add(gdbctx, "</library-list>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void packet_query_threads(struct gdb_context* gdbctx)
|
||||||
|
{
|
||||||
|
struct dbg_process* process = gdbctx->process;
|
||||||
|
struct dbg_thread* thread;
|
||||||
|
|
||||||
|
packet_reply_add(gdbctx, "<threads>");
|
||||||
|
LIST_FOR_EACH_ENTRY(thread, &process->threads, struct dbg_thread, entry)
|
||||||
|
{
|
||||||
|
packet_reply_add(gdbctx, "<thread ");
|
||||||
|
packet_reply_add(gdbctx, "id=\"");
|
||||||
|
packet_reply_val(gdbctx, thread->tid, 4);
|
||||||
|
packet_reply_add(gdbctx, "\" name=\"");
|
||||||
|
packet_reply_add(gdbctx, thread->name);
|
||||||
|
packet_reply_add(gdbctx, "\"/>");
|
||||||
|
}
|
||||||
|
packet_reply_add(gdbctx, "</threads>");
|
||||||
|
}
|
||||||
|
|
||||||
static enum packet_return packet_query(struct gdb_context* gdbctx)
|
static enum packet_return packet_query(struct gdb_context* gdbctx)
|
||||||
{
|
{
|
||||||
int off, len;
|
int off, len;
|
||||||
|
@ -1614,6 +1632,7 @@ static enum packet_return packet_query(struct gdb_context* gdbctx)
|
||||||
packet_reply_open(gdbctx);
|
packet_reply_open(gdbctx);
|
||||||
packet_reply_add(gdbctx, "QStartNoAckMode+;");
|
packet_reply_add(gdbctx, "QStartNoAckMode+;");
|
||||||
packet_reply_add(gdbctx, "qXfer:libraries:read+;");
|
packet_reply_add(gdbctx, "qXfer:libraries:read+;");
|
||||||
|
packet_reply_add(gdbctx, "qXfer:threads:read+;");
|
||||||
if (*target_xml) packet_reply_add(gdbctx, "PacketSize=400;qXfer:features:read+");
|
if (*target_xml) packet_reply_add(gdbctx, "PacketSize=400;qXfer:features:read+");
|
||||||
packet_reply_close(gdbctx);
|
packet_reply_close(gdbctx);
|
||||||
return packet_done;
|
return packet_done;
|
||||||
|
@ -1655,6 +1674,16 @@ static enum packet_return packet_query(struct gdb_context* gdbctx)
|
||||||
return packet_done;
|
return packet_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sscanf(gdbctx->in_packet, "Xfer:threads:read::%x,%x", &off, &len) == 2)
|
||||||
|
{
|
||||||
|
if (!gdbctx->process) return packet_error;
|
||||||
|
|
||||||
|
packet_reply_open_xfer(gdbctx);
|
||||||
|
packet_query_threads(gdbctx);
|
||||||
|
packet_reply_close_xfer(gdbctx, off, len);
|
||||||
|
return packet_done;
|
||||||
|
}
|
||||||
|
|
||||||
if (*target_xml && strncmp(gdbctx->in_packet, "Xfer:features:read:target.xml", 29) == 0)
|
if (*target_xml && strncmp(gdbctx->in_packet, "Xfer:features:read:target.xml", 29) == 0)
|
||||||
return packet_reply(gdbctx, target_xml);
|
return packet_reply(gdbctx, target_xml);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue