From 05e0d633bad9e8b0bdfaf16fc76ab1f9d9419d8b Mon Sep 17 00:00:00 2001 From: Steven Stallion Date: Tue, 9 Oct 2018 13:48:18 -0500 Subject: [PATCH] rtos: check symbol list when updating uCOS-III This patch corrects a crash in uCOS-III on a new GDB connection when RTOS autodetection is not used. The crash was caused by not checking if the symbol list had been loaded prior to updating threads. Change-Id: I64c5133e02fe22fc8d14584cc40d87b49c935b0b Signed-off-by: Steven Stallion Reviewed-on: http://openocd.zylin.com/4719 Tested-by: jenkins Reviewed-by: Matthias Welwarsky --- src/rtos/uCOS-III.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rtos/uCOS-III.c b/src/rtos/uCOS-III.c index 3cd9c2ae..304d07c5 100644 --- a/src/rtos/uCOS-III.c +++ b/src/rtos/uCOS-III.c @@ -300,6 +300,11 @@ static int uCOS_III_update_threads(struct rtos *rtos) struct uCOS_III_params *params = rtos->rtos_specific_params; int retval; + if (rtos->symbols == NULL) { + LOG_ERROR("uCOS-III: symbol list not loaded"); + return ERROR_FAIL; + } + /* free previous thread details */ rtos_free_threadlist(rtos); -- 2.39.5