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

Function db_show_threads

freebsd/ddb/db_thread.c:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void
81db_show_threads(db_expr_t addr, bool hasaddr, db_expr_t cnt, char *mod)
82{
83 jmp_buf jb;
84 void *prev_jb;
85 struct thread *thr;
86
87 thr = kdb_thr_first();
88 while (!db_pager_quit && thr != NULL) {
89 db_printf(" %6ld (%p) (stack %p) ", (long)thr->td_tid, thr,
90 (void *)thr->td_kstack);
91 prev_jb = kdb_jmpbuf(jb);
92 if (setjmp(jb) == 0) {
93 if (thr->td_proc->p_flag & P_INMEM) {
94 if (db_trace_thread(thr, 1) != 0)
95 db_printf("***\n");
96 } else
97 db_printf("*** swapped out\n");
98 }
99 kdb_jmpbuf(prev_jb);
100 thr = kdb_thr_next(thr);
101 }
102}
103
104/*
105 * Lookup a thread based on a db expression address. We assume that the

Callers

nothing calls this directly

Calls 6

kdb_thr_firstFunction · 0.85
db_printfFunction · 0.85
kdb_jmpbufFunction · 0.85
setjmpFunction · 0.85
kdb_thr_nextFunction · 0.85
db_trace_threadFunction · 0.50

Tested by

no test coverage detected