gdb(4): Support "qC" query

Sometimes GDB gets confused about what the current thread is.  When it does,
it asks the remote: "Who am I?"

Answer it.
This commit is contained in:
cem 2019-08-19 22:58:30 +00:00
parent ddc3aef3cd
commit 55e241079c

View File

@ -305,7 +305,13 @@ gdb_trap(int type, int code)
break;
}
case 'q': /* General query. */
if (gdb_rx_equal("fThreadInfo")) {
if (gdb_rx_equal("C")) {
gdb_tx_begin('Q');
gdb_tx_char('C');
gdb_tx_varhex((long)kdb_thread->td_tid);
gdb_tx_end();
break;
} else if (gdb_rx_equal("fThreadInfo")) {
thr_iter = kdb_thr_first();
gdb_do_threadinfo(&thr_iter);
} else if (gdb_rx_equal("sThreadInfo")) {