From: Matthias Welwarsky Date: Fri, 17 Feb 2017 15:18:09 +0000 (+0100) Subject: gdb_server: update rtos threads on new connection X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6168a806946d16e1862fa35d287d46e3cae34078;p=openocd 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 --- 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);