Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define zephyr_show_thread
- printf "State=%d; ", ((struct k_thread *)$arg0)->base.thread_state
- printf "Prio=%d; ", ((struct k_thread *)$arg0)->base.prio
- printf "Entry=%p; ", ((struct k_thread *)$arg0)->entry.pEntry
- printf "PC=%p; ", *(((struct k_thread *)$arg0)->callee_saved.psp + 20)
- printf "PSP=%p; ", ((struct k_thread *)$arg0)->callee_saved.psp + 32
- set $stack_start = ((struct k_thread *)$arg0)->stack_info.start
- set $stack_size = ((struct k_thread *)$arg0)->stack_info.size
- printf "Stack: %p <- %p (%u bytes)", $stack_start, $stack_start + $stack_size, $stack_size
- end
- define zephyr_list_threads
- set $current_thread = _kernel.threads
- set $idx = 0
- while ($current_thread != 0)
- printf "Thread %02d (%p) ", $idx, $current_thread
- zephyr_show_thread $current_thread
- if ($current_thread == _kernel->current)
- printf " <- RUNNING"
- end
- printf "\n"
- set $PC = *(((struct k_thread *)$current_thread)->callee_saved.psp + 20)
- printf "\t"
- info line *$PC
- set $idx = $idx + 1
- set $current_thread = $current_thread->next_thread
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement