From 55e241079c05ca6798450f82b5d9a95718f84cbd Mon Sep 17 00:00:00 2001 From: cem Date: Mon, 19 Aug 2019 22:58:30 +0000 Subject: [PATCH] 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. --- sys/gdb/gdb_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index aabbf983ba25..20d9fcc3bc97 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -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")) {