Add kdb_thr_from_pid(), which given a PID returns the first thread
in the process. This is useful when working from or with a process.
This commit is contained in:
parent
09281f58ed
commit
3d4f313695
@ -316,7 +316,21 @@ kdb_thr_first(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct thread *
|
struct thread *
|
||||||
kdb_thr_lookup(pid_t tid)
|
kdb_thr_from_pid(pid_t pid)
|
||||||
|
{
|
||||||
|
struct proc *p;
|
||||||
|
|
||||||
|
p = LIST_FIRST(&allproc);
|
||||||
|
while (p != NULL) {
|
||||||
|
if (p->p_sflag & PS_INMEM && p->p_pid == pid)
|
||||||
|
return (FIRST_THREAD_IN_PROC(p));
|
||||||
|
p = LIST_NEXT(p, p_list);
|
||||||
|
}
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct thread *
|
||||||
|
kdb_thr_lookup(lwpid_t tid)
|
||||||
{
|
{
|
||||||
struct thread *thr;
|
struct thread *thr;
|
||||||
|
|
||||||
|
@ -71,7 +71,8 @@ void * kdb_jmpbuf(jmp_buf);
|
|||||||
void kdb_reenter(void);
|
void kdb_reenter(void);
|
||||||
struct pcb *kdb_thr_ctx(struct thread *);
|
struct pcb *kdb_thr_ctx(struct thread *);
|
||||||
struct thread *kdb_thr_first(void);
|
struct thread *kdb_thr_first(void);
|
||||||
struct thread *kdb_thr_lookup(pid_t);
|
struct thread *kdb_thr_from_pid(pid_t);
|
||||||
|
struct thread *kdb_thr_lookup(lwpid_t);
|
||||||
struct thread *kdb_thr_next(struct thread *);
|
struct thread *kdb_thr_next(struct thread *);
|
||||||
int kdb_thr_select(struct thread *);
|
int kdb_thr_select(struct thread *);
|
||||||
int kdb_trap(int, int, struct trapframe *);
|
int kdb_trap(int, int, struct trapframe *);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user