openocd/src/rtos
Frank Dischner df75bbd536 FreeRTOS: Always show current execution before scheduler is started
Previously, if the target was halted before the FreeRTOS scheduler was
started but after at least one thread was created, then the current thread
would be set to whichever thread had the highest priority. In addition to
being misleading, because that thread is not actually running, it can
cause issues with gdb. For instance, breaking somewhere before the first
thread is created will show the current execution as the current thread,
but stepping over a line that creates a thread will cause the current
thread to switch to the newly created thread and the current execution to
disappear. The sudden disappearance of the current execution thread seems
to confuse some versions of gdb.

With this change, the value of xSchedulerRunning is checked to determine
whether the scheduler has been started. If it hasn't, then a fake
'current execution' thread is always created and made the current thread.

Signed-off-by: Frank Dischner <frank.dischner@gmail.com>
Change-Id: Ide0fe7d9ffb9fac95cee4c805735f434c7c4934d
Reviewed-on: https://review.openocd.org/c/openocd/+/6935
Tested-by: jenkins
Reviewed-by: Asier Llano <asierllano@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-08-08 20:48:10 +00:00
..
FreeRTOS.c FreeRTOS: Always show current execution before scheduler is started 2022-08-08 20:48:10 +00:00
Makefile.am openocd: build: add SPDX tag 2022-07-23 13:06:38 +00:00
ThreadX.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
chibios.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
chromium-ec.c openocd: src: fix incorrect SPDX tags 2022-07-23 13:16:09 +00:00
eCos.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
embKernel.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
hwthread.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
linux.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
linux_header.h openocd: src: add GPL license tag on files that miss it 2022-07-23 13:13:39 +00:00
mqx.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
nuttx.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
nuttx_header.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
riot.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_chibios_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_chibios_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_ecos_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_ecos_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_embkernel_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_embkernel_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_mqx_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_mqx_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_riot_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_riot_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_standard_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_standard_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_ucos_iii_stackings.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
rtos_ucos_iii_stackings.h openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
uCOS-III.c openocd: src/rtos: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:32 +00:00
zephyr.c openocd: src: fix incorrect SPDX tags 2022-07-23 13:16:09 +00:00