3 #include "thread_object.h"
12 #include "jdb_kobject.h"
14 #include "thread_state.h"
21 Jdb_thread::print_state_long(Thread *t, unsigned cut_on_len = 0)
23 static char const * const state_names[] =
25 "ready", "drq_rdy", "send", "rcv_wait",
26 "rcv_in_progr", "transfer", "<unk>", "cancel",
27 "timeout", "dead", "suspended", "<unk>",
28 "<unk>", "<unk>", "<unk>", "fpu",
29 "alien", "dealien", "exc_progr", "<unk>",
30 "drq", "lock_wait", "vcpu", "<unk>",
31 "vcpu_fpu_disabled", "vcpu_ext"
37 Mword bits = t->state(false);
39 for (unsigned i = 0; i < sizeof (state_names) / sizeof (char *);
47 unsigned add = strlen(state_names[i]) + comma;
48 if (chars + add > cut_on_len)
50 if (chars < cut_on_len - 4)
57 printf("%s%s", "," + !comma, state_names[i]);
65 Jdb_thread::print_snd_partner(Thread *t, int task_format = 0)
67 if (t->state(false) & Thread_send_wait)
68 Jdb_kobject::print_uid(static_cast<Thread*>(t->receiver()), task_format);
70 // receiver() not valid
76 Jdb_thread::print_partner(Thread *t, int task_format = 0)
78 Sender *p = t->partner();
80 if ((t->state(false) & Thread_ipc_mask) != Thread_receive_wait)
82 printf("%*s ", task_format, " ");
88 printf("%*s ", task_format, "-");
92 if (Kobject *o = Kobject::pointer_to_obj(p))
95 const char *n = o->kobj_type();
97 if (n == Thread_object::static_kobj_type)
99 else if (n == Irq::static_kobj_type)
102 printf("%*.lx%c", task_format, o->dbg_info()->dbg_id(), flag);
105 printf("\033[31;1m%p\033[m ", p);