| 78 | } |
| 79 | |
| 80 | void |
| 81 | db_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 |
nothing calls this directly
no test coverage detected