ddb: Print the thread's pcb in 'show thread'

This can aid with debugging when a thread is running and has no backtrace.
State can be estimated based on the pcb, and refined from there, for
example, to get a rough idea of the stack pointer.
This commit is contained in:
jhibbits 2019-02-09 21:08:19 +00:00
parent 1c46a14971
commit b673a11d47

View File

@ -352,6 +352,7 @@ DB_SHOW_COMMAND(thread, db_show_thread)
db_printf(" proc (pid %d): %p\n", td->td_proc->p_pid, td->td_proc);
if (td->td_name[0] != '\0')
db_printf(" name: %s\n", td->td_name);
db_printf(" pcb: %p\n", td->td_pcb);
db_printf(" stack: %p-%p\n", (void *)td->td_kstack,
(void *)(td->td_kstack + td->td_kstack_pages * PAGE_SIZE - 1));
db_printf(" flags: %#x ", td->td_flags);