MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_lookup_proc

Function db_lookup_proc

freebsd/ddb/db_thread.c:143–157  ·  view source on GitHub ↗

* Lookup a process based on a db expression address. We assume that the * address was parsed in hexadecimal. We reparse the address in decimal * first and try to treat it as a PID to find an associated process. * If that fails we treat the addr as a pointer to a process. */

Source from the content-addressed store, hash-verified

141 * If that fails we treat the addr as a pointer to a process.
142 */
143struct proc *
144db_lookup_proc(db_expr_t addr)
145{
146 db_expr_t decaddr;
147 struct proc *p;
148
149 decaddr = db_hex2dec(addr);
150 if (decaddr != -1) {
151 LIST_FOREACH(p, PIDHASH(decaddr), p_hash) {
152 if (p->p_pid == decaddr)
153 return (p);
154 }
155 }
156 return ((struct proc *)addr);
157}

Callers 2

db_ps.cFile · 0.85
vm_map.cFile · 0.85

Calls 1

db_hex2decFunction · 0.85

Tested by

no test coverage detected