cvs commit: src/sys/ddb db_thread.c ddb.h

John Baldwin jhb at
Tue Apr 25 20:22:55 UTC 2006

jhb         2006-04-25 20:22:49 UTC

  FreeBSD src repository

  Modified files:
    sys/ddb              db_thread.c ddb.h 
  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

More information about the cvs-src mailing list