From 6168a806946d16e1862fa35d287d46e3cae34078 Mon Sep 17 00:00:00 2001 From: Matthias Welwarsky Date: Fri, 17 Feb 2017 16:18:09 +0100 Subject: [PATCH] gdb_server: update rtos threads on new connection make sure the RTOS thread database is updated early on a new gdb connection. Change-Id: I4da9ef30f8634263d697116cefc47976cd1970ad Signed-off-by: Matthias Welwarsky Reviewed-on: http://openocd.zylin.com/4000 Reviewed-by: Matthias Welwarsky Tested-by: jenkins --- src/server/gdb_server.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 42ac8a5e..cbf1ca9f 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -961,9 +961,14 @@ static int gdb_new_connection(struct connection *connection) breakpoint_clear_target(target); watchpoint_clear_target(target); - /* clean previous rtos session if supported*/ - if ((target->rtos) && (target->rtos->type->clean)) - target->rtos->type->clean(target); + if (target->rtos) { + /* clean previous rtos session if supported*/ + if (target->rtos->type->clean) + target->rtos->type->clean(target); + + /* update threads */ + rtos_update_threads(target); + } /* remove the initial ACK from the incoming buffer */ retval = gdb_get_char(connection, &initial_ack); -- 2.39.5