diff options
author | craigblackmore <craig.blackmore@bristol.ac.uk> | 2018-08-27 20:42:21 +0100 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-08-27 12:42:21 -0700 |
commit | 8ede238449661581b31e09b7d328ae4d9b51406d (patch) | |
tree | dd946c4b6a9834e787780edc57b20e8270446f31 | |
parent | f54eaf0b8e5b563e6906c00734d79770a5ed705f (diff) | |
download | riscv-openocd-8ede238449661581b31e09b7d328ae4d9b51406d.zip riscv-openocd-8ede238449661581b31e09b7d328ae4d9b51406d.tar.gz riscv-openocd-8ede238449661581b31e09b7d328ae4d9b51406d.tar.bz2 |
Handle the qC packet (#292)
* Handle the qC packet
GDB sends the qC packet to find out which thread OpenOCD is on
* Correct format string for qC packet
-rw-r--r-- | src/rtos/riscv_debug.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rtos/riscv_debug.c b/src/rtos/riscv_debug.c index fa8f13a..afb3508 100644 --- a/src/rtos/riscv_debug.c +++ b/src/rtos/riscv_debug.c @@ -124,6 +124,13 @@ static int riscv_gdb_thread_packet(struct connection *connection, const char *pa return ERROR_OK; } + if (strncmp(packet, "qC", 2) == 0) { + char rep_str[32]; + snprintf(rep_str, 32, "QC%" PRIx64, rtos->current_threadid); + gdb_put_packet(connection, rep_str, strlen(rep_str)); + return ERROR_OK; + } + return GDB_THREAD_PACKET_NOT_CONSUMED; case 'Q': |