From 2afce774e7448f9da2c9e4f73c48a41fdde6663f Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Tue, 23 Nov 2004 23:07:12 +0000 Subject: [PATCH] When printing information on the current thread, such as when entering DDB, also print the pid of the process if present. Since much debugging still centers around processes, having the pid is quite helpful. --- sys/ddb/db_thread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/ddb/db_thread.c b/sys/ddb/db_thread.c index 8994f9647ff..5a8557a0a65 100644 --- a/sys/ddb/db_thread.c +++ b/sys/ddb/db_thread.c @@ -41,7 +41,12 @@ __FBSDID("$FreeBSD$"); void db_print_thread(void) { - db_printf("[thread %ld]\n", (long)kdb_thread->td_tid); + pid_t pid; + + pid = -1; + if (kdb_thread->td_proc != NULL) + pid = kdb_thread->td_proc->p_pid; + db_printf("[thread pid %d tid %ld ]\n", pid, (long)kdb_thread->td_tid); } void