xtensa: debug: enable xtensa thread awareness

Enable stack offset switching for Xtensa targets if arch_switch is used.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This commit is contained in:
Marek Matej
2025-11-14 21:45:05 +00:00
committed by Maureen Helm
parent b6e6a4c0c4
commit 45dd7fa9ad

View File

@@ -86,12 +86,16 @@ const size_t _kernel_thread_info_offsets[] = {
[THREAD_INFO_OFFSET_T_STACK_PTR] = offsetof(struct k_thread,
callee_saved.thread_status),
#elif defined(CONFIG_XTENSA)
/* Xtensa does not store stack pointers inside thread objects.
* The registers are saved in thread stack where there is
* no fixed location for this to work. So mark this as
* unimplemented to avoid the #warning below.
*/
/* Xtensa does not store stack pointers inside thread objects.
* The registers are saved in thread stack where there is
* no fixed location for this to work. It needs arch_switch in
* order to work on Xtensa.
*/
#ifdef CONFIG_USE_SWITCH
[THREAD_INFO_OFFSET_T_STACK_PTR] = offsetof(struct k_thread, switch_handle),
#else
[THREAD_INFO_OFFSET_T_STACK_PTR] = THREAD_INFO_UNIMPLEMENTED,
#endif
#elif defined(CONFIG_RX)
/* RX doesn't store *anything* inside thread objects yet */
[THREAD_INFO_OFFSET_T_STACK_PTR] = THREAD_INFO_UNIMPLEMENTED,