shell: kernel: add command to unwind a thread
Add a shell command to unwind a thread using its thread id.
uart:~$ kernel threads
Scheduler: 11 since last call
Threads:
*0x80017138 shell_uart
options: 0x0, priority: 14 timeout: 0
state: queued, entry: 0x800029ac
stack size 3072, unused 1316, usage 1756 / 3072 (57 %)
0x80017ca8 sysworkq
options: 0x1, priority: -1 timeout: 0
state: pending, entry: 0x80006842
stack size 1024, unused 644, usage 380 / 1024 (37 %)
0x800177e0 idle
options: 0x1, priority: 15 timeout: 0
state: , entry: 0x800065ae
stack size 512, unused 180, usage 332 / 512 (64 %)
0x80017950 main
options: 0x1, priority: 0 timeout: 13
state: suspended, entry: 0x80006326
stack size 4096, unused 3604, usage 492 / 4096 (12 %)
uart:~$ kernel unwind 0x80017ca8
Unwinding 0x80017ca8 sysworkq
ra: 0x80007114 [z_swap+0x58]
ra: 0x80007ae8 [z_sched_wait+0x10]
ra: 0x8000689a [work_queue_main+0x58]
ra: 0x800006de [z_thread_entry+0x2e]
Signed-off-by: Yong Cong Sin <ycsin@meta.com>