From 517ba0d3f102d15a86de0251a484885ee2ac999c Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sat, 9 Feb 2019 21:08:19 +0000 Subject: [PATCH] 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. --- sys/ddb/db_ps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index 2c7c205785bf..64f8075e8061 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -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);