Using RTOS support in OpenOCD
Indeed the documentation for this amazing feature is rather poor, however there is a guide for ChibiOS. Basically this boils down to:


pass -rtos auto to {TARGET_NAME}.cpu configure in the Tcl configuration script
use thread commands in gdb, where info threads is the probably the one you will use most