svn commit: r343943 - head/sys/ddb

Justin Hibbits jhibbits at
Sat Feb 9 21:08:20 UTC 2019

Author: jhibbits
Date: Sat Feb  9 21:08:19 2019
New Revision: 343943

  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.


Modified: head/sys/ddb/db_ps.c
--- head/sys/ddb/db_ps.c	Sat Feb  9 16:53:39 2019	(r343942)
+++ head/sys/ddb/db_ps.c	Sat Feb  9 21:08:19 2019	(r343943)
@@ -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);

More information about the svn-src-all mailing list