INTERFACE:
-#include "thread.h"
+#include "thread_object.h"
class Jdb_thread
{
#include "irq.h"
#include "jdb_kobject.h"
+#include "kobject.h"
#include "thread_state.h"
#include "vlog.h"
Jdb_thread::print_snd_partner(Thread *t, int task_format = 0)
{
if (t->state() & Thread_send_in_progress)
- Jdb_kobject::print_uid(t->lookup(static_cast<Thread*>(t->receiver())), task_format);
+ Jdb_kobject::print_uid(t->lookup(static_cast<Thread*>(t->receiver()))->kobject(), task_format);
else
// receiver() not valid
putstr(" ");
void
Jdb_thread::print_partner(Thread *t, int task_format = 0)
{
- Thread *p;
Kobject *o;
if (!(t->state() & (Thread_receiving | Thread_busy)))
return;
}
- // the Thread* cast is not good because we actually need to have a dynamic
- // cast but we don't have this here in this environment. Luckily the cast
- // works...
- if (Kobject::is_kobj(p = static_cast<Thread*>(t->partner())))
+ if (Kobject::is_kobj(o = Kobject::pointer_to_obj(t->partner())))
{
- char flag = ' ';
- printf("%*.lx%c", task_format, p->dbg_id(), flag);
+ char flag = '?';
+ const char *n = o->kobj_type();
+
+ if (n == Thread_object::static_kobj_type)
+ flag = ' ';
+ else if (n == Irq::static_kobj_type)
+ flag = '*';
+
+ printf("%*.lx%c", task_format, o->dbg_info()->dbg_id(), flag);
}
- else if ((o = Kobject::pointer_to_obj(t->partner())))
- printf("%*.lx*", task_format, o->dbg_id());
else
printf("\033[31;1m%p\033[m ", t->partner());
}