Use kdb_thr_from_pid() in db_lookup_thread().

The code is identical, so this should be a no-op.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27828
This commit is contained in:
John Baldwin 2020-12-31 16:01:27 -08:00
parent 825d234144
commit ae450907c6

View File

@ -114,7 +114,6 @@ db_lookup_thread(db_expr_t addr, bool check_pid)
{
struct thread *td;
db_expr_t decaddr;
struct proc *p;
/*
* If the parsed address was not a valid decimal expression,
@ -128,10 +127,9 @@ db_lookup_thread(db_expr_t addr, bool check_pid)
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);
}