diff --git a/sys/ddb/db_thread.c b/sys/ddb/db_thread.c --- a/sys/ddb/db_thread.c +++ b/sys/ddb/db_thread.c @@ -114,7 +114,6 @@ { struct thread *td; db_expr_t decaddr; - struct proc *p; /* * If the parsed address was not a valid decimal expression, @@ -128,10 +127,9 @@ if (td != NULL) return (td); if (check_pid) { - LIST_FOREACH(p, PIDHASH(decaddr), p_hash) { - if (p->p_pid == decaddr) - return (FIRST_THREAD_IN_PROC(p)); - } + td = kdb_thr_from_pid(decaddr); + if (td != NULL) + return (td); } return ((struct thread *)addr); }