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 <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/4000
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Tested-by: jenkins
riscv-compliance-dev
Matthias Welwarsky 2017-02-17 16:18:09 +01:00 committed by Matthias Welwarsky
parent 3aa8bd2d17
commit 6168a80694
1 changed files with 8 additions and 3 deletions

View File

@ -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);