diff options
author | Richard Braun <rbraun@sceen.net> | 2015-03-11 14:04:15 +0100 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2015-04-14 12:16:50 +0100 |
commit | 7090edc813525caaade84a6322fdce89d3cd8f6a (patch) | |
tree | ac81640e33dba8599e9c628547a9514f599573a7 /src/rtos | |
parent | 19f219f731f29503c8e4d432935d3ea558cc1659 (diff) | |
download | riscv-openocd-7090edc813525caaade84a6322fdce89d3cd8f6a.zip riscv-openocd-7090edc813525caaade84a6322fdce89d3cd8f6a.tar.gz riscv-openocd-7090edc813525caaade84a6322fdce89d3cd8f6a.tar.bz2 |
ChibiOS: fix crash on auto detection
The detection framework assumes rtos->symbols is dynamically allocated,
an assumption that the ChibiOS variant breaks by providing a raw statically
allocated symbol list.
Change-Id: I379bcc2af99006912608ddd3f646ff7085606f47
Signed-off-by: Richard Braun <rbraun@sceen.net>
Reviewed-on: http://openocd.zylin.com/2597
Tested-by: jenkins
Reviewed-by: Stian Skjelstad <stian@nixia.no>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'src/rtos')
-rw-r--r-- | src/rtos/ChibiOS.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rtos/ChibiOS.c b/src/rtos/ChibiOS.c index b94e286..8439386 100644 --- a/src/rtos/ChibiOS.c +++ b/src/rtos/ChibiOS.c @@ -507,7 +507,12 @@ static int ChibiOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, cha static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]) { - *symbol_list = ChibiOS_symbol_list; + *symbol_list = malloc(sizeof(ChibiOS_symbol_list)); + + if (*symbol_list == NULL) + return ERROR_FAIL; + + memcpy(*symbol_list, ChibiOS_symbol_list, sizeof(ChibiOS_symbol_list)); return 0; } |