Date: Tue, 25 Apr 2006 20:22:49 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/ddb db_thread.c ddb.h Message-ID: <200604252022.k3PKMnO5043876@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2006-04-25 20:22:49 UTC FreeBSD src repository Modified files: sys/ddb db_thread.c ddb.h Log: Add two helper functions: db_lookup_thread() and db_lookup_proc(). They take the addr value passed to a ddb command and attempt to use it to lookup a struct thread * or struct proc *, respectively. Each function first reparses the passed in value as if it was an ID entered in base 10. For threads the ID is treated as a thread ID, for proceses the ID is treated as a PID. If a thread or proc matching the ID is found, it is returned. For db_lookup_thread(), if the check_pid argument is true and it didn't find a thread with a matching thread ID, it will treat the ID as a PID and look for a matching process. If it finds one it returns the first thread in the process. If none of the ID lookups succeeded, then the functions assume that the passed in address is a thread or proc pointer, respectively. This allows one to use tids, pids, or structure pointers interchangeably in ddb functions that want to lookup threads or processes if desired. Revision Changes Path 1.5 +92 -0 src/sys/ddb/db_thread.c 1.42 +2 -0 src/sys/ddb/ddb.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604252022.k3PKMnO5043876>