Hi All,

 

I have developed an extension to OpenOCD which allows it to be aware of an
RTOS and pass thread information to GDB.

It currently works for FreeRTOS and ThreadX on a Cortex-M3 but still has
some work to get it cleaned up and fully reliable, but I am wondering what
the procedure for integrating a fairly large change like this.

 

The main changes are to /src/server/gdb_server/gdb_server.c, however the
changes open the door for needing many source files for representing various
RTOS threading implementations, so would probably require a new directory
/src/rtos or similar.

 

Basically the changes implement the qSymbol command which allows an OpenOCD
then to look up the address of the RTOS task list. The task IDs are then
passed to GDB via the qfThreadInfo and qsThreadInfo commands.  GDB then
requests extra information about each task, so the task Name/Status are
obtained from the target. GDB also requests the register values, so the "g"
command has been modified, so that it looks up the thread stack pointer,
reads the registers pushed onto it, and passes them in place of the actual
registers.

I've implemented the RTOS specific code in a way that will not require
copying of structures from non-open-licensed header files. This has been
done by just having a list of byte offsets for each required location.

 

I still need to figure out how to handle interrupts, as I'd like them to
appear as separate threads, but currently they will obscure the currently
running thread.

 

Regards,

 

Evan Hunter

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to