summaryrefslogtreecommitdiffstats
path: root/sys/ddb/ddb.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-04-25 20:22:48 +0000
committerjhb <jhb@FreeBSD.org>2006-04-25 20:22:48 +0000
commit819f9866cd1dc759418685f6f6b7a0743dd17df7 (patch)
tree5fe039d6c6b0a45e1f891fbf1c32071b18e1ca50 /sys/ddb/ddb.h
parent3ccc5435bf4adaeff66cedce39fddd4ea027fbc8 (diff)
downloadFreeBSD-src-819f9866cd1dc759418685f6f6b7a0743dd17df7.zip
FreeBSD-src-819f9866cd1dc759418685f6f6b7a0743dd17df7.tar.gz
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.
Diffstat (limited to 'sys/ddb/ddb.h')
-rw-r--r--sys/ddb/ddb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h
index 33021c9..549e24e 100644
--- a/sys/ddb/ddb.h
+++ b/sys/ddb/ddb.h
@@ -101,6 +101,8 @@ void db_error(const char *s);
int db_expression(db_expr_t *valuep);
int db_get_variable(db_expr_t *valuep);
void db_iprintf(const char *,...) __printflike(1, 2);
+struct proc *db_lookup_proc(db_expr_t addr);
+struct thread *db_lookup_thread(db_expr_t addr, boolean_t check_pid);
struct vm_map *db_map_addr(vm_offset_t);
boolean_t db_map_current(struct vm_map *);
boolean_t db_map_equal(struct vm_map *, struct vm_map *);
OpenPOWER on IntegriCloud