I have been trying to add eCos/Cortex-M3 RTOS support to OpenOCD, and have some code that seems to go some way toward doing the right thing. The first patch adds that support - it contains a new file (based heavily on the existing ThreadX/FreeRTOS model) to parse the thread list. It's not the most efficient - it iterates over a linked list twice - once to count the entries and once to parse out the information. I couldn't see an explicit thread count variable to parse, and I wanted to keep the code as similar to previous to minimise my chances of making mistakes. I have also added a different register-stacking structure in another file.
With that first patch in place, I found GDB would display the thread list with "info threads" but would then become unstable (as described in a previous email). I found that when GDB requested the current thread ("qC") OpenOCD always replied with a generic response ("QC0"). I altered this to try to report the actual current thread, as in the second patch. The first time GDB runs up, the instability still occurs, since the request is sent before OpenOCD has parsed the thread data. Stopping GDB and restarting it then seems to work OK, since a current thread value is retained in OpenOCD's rtos data structure from the last session. This seems like the wrong behaviour, but is coincidentally sufficient to prevent GDB from complaining. I'd be interested to hear if anyone has seen similar behaviour with other RTOSs. Testing for these patches has been performed using top-of-trunk eCos running in a ROM startup configuration from a board like an STM3210E-EVAL (but only using internal RAM). I've been using the thread<x> test programs that are part of the kernel test suite as test applications. I'm not sure how to take this further - I'm not sufficiently familiar with GDB to diagnose the problem I'm seeing with the current-thread reporting, but I want to put eCos support in front of others to get some feedback. Alan
0001-Add-eCos-Cortex-RTOS-support.patch
Description: Binary data
0002-Report-actual-current-thread.patch
Description: Binary data
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development