]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/jdb/arm/jdb_vm.cpp
update
[l4.git] / kernel / fiasco / src / jdb / arm / jdb_vm.cpp
1 IMPLEMENTATION [tz]:
2
3 #include <climits>
4 #include <cstring>
5 #include <cstdio>
6
7 #include "jdb.h"
8 #include "jdb_core.h"
9 #include "jdb_module.h"
10 #include "jdb_screen.h"
11 #include "jdb_kobject.h"
12 #include "kernel_console.h"
13 #include "keycodes.h"
14 #include "simpleio.h"
15 #include "static_init.h"
16 #include "vm.h"
17
18 class Jdb_vm : public Jdb_kobject_handler
19 {
20 public:
21   Jdb_vm() FIASCO_INIT;
22 };
23
24 IMPLEMENT
25 Jdb_vm::Jdb_vm()
26   : Jdb_kobject_handler(Vm::static_kobj_type)
27 {
28   Jdb_kobject::module()->register_handler(this);
29 }
30
31 PUBLIC
32 bool
33 Jdb_vm::show_kobject(Kobject_common *o, int lvl)
34 {
35   Kobject::dcast<Vm*>(o)->dump_machine_state();
36   if (lvl)
37     {
38       Jdb::getchar();
39       return true;
40     }
41
42   return false;
43 }
44
45 PUBLIC
46 char const *
47 Jdb_vm::kobject_type() const
48 {
49   return JDB_ANSI_COLOR(yellow) "Vm" JDB_ANSI_COLOR(default);
50 }
51
52 PUBLIC
53 int
54 Jdb_vm::show_kobject_short(char *buf, int max, Kobject_common *o)
55 {
56   return Kobject::dcast<Vm*>(o)->show_short(buf, max);
57 }
58
59 static Jdb_vm jdb_vm INIT_PRIORITY(JDB_MODULE_INIT_PRIO);
60
61 static
62 bool
63 filter_vm(Kobject_common const *o)
64 {
65   return Kobject::dcast<Vm const *>(o);
66 }
67 static Jdb_kobject_list::Mode INIT_PRIORITY(JDB_MODULE_INIT_PRIO) tnt("[Vms]", filter_vm);