From 50dd7207eaae9d2d1f02e7996135d6257c03b395 Mon Sep 17 00:00:00 2001 From: Steven Stallion Date: Wed, 20 Jul 2016 21:09:24 -0500 Subject: gdb_server: support qXfer:threads:read packet This patch adds support for the qXfer:threads:read packet. In addition to providing a more efficient method of updating thread state, recent versions of GDB (7.11.1 and up) can also report remote thread names. While thread names are not enabled in this patch due to its limited applicability at the moment, it can be enabled at a later date with little effort. As a part of revamping how threads are presented to GDB, extra info strings for each of the supported RTOSes were updated to match conventions present in the GDB source code. For more information, see remote_threads_extra_info() in remote.c. This results in a much smoother experience when interacting with GDB. It is also worth mentioning that use of qXfer:threads:read works around a number of regressions in older versions of GDB regarding remote thread display. Trust me, it's great. Change-Id: I97dd6a93c342ceb9b9d0023b6359db0e5604c6e6 Signed-off-by: Steven Stallion Reviewed-on: http://openocd.zylin.com/3559 Tested-by: jenkins Reviewed-by: Tomas Vanek Reviewed-by: Paul Fertser --- src/rtos/ChibiOS.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rtos/ChibiOS.c') diff --git a/src/rtos/ChibiOS.c b/src/rtos/ChibiOS.c index 00e9df7..1bc1af8 100644 --- a/src/rtos/ChibiOS.c +++ b/src/rtos/ChibiOS.c @@ -440,11 +440,11 @@ static int ChibiOS_update_threads(struct rtos *rtos) if (threadState < CHIBIOS_NUM_STATES) state_desc = ChibiOS_thread_states[threadState]; else - state_desc = "Unknown state"; + state_desc = "Unknown"; curr_thrd_details->extra_info_str = malloc(strlen( - state_desc)+1); - strcpy(curr_thrd_details->extra_info_str, state_desc); + state_desc)+8); + sprintf(curr_thrd_details->extra_info_str, "State: %s", state_desc); curr_thrd_details->exists = true; -- cgit v1.1