7 #include "jdb_module.h"
8 #include "static_init.h"
13 * Private 'exit' module.
15 * This module handles the 'exit' or '^' command that
16 * makes a call to exit() and virtually reboots the system.
18 class Jdb_trap_state_module : public Jdb_module
21 Jdb_trap_state_module() FIASCO_INIT;
24 static Jdb_trap_state_module jdb_trap_state_module INIT_PRIORITY(JDB_MODULE_INIT_PRIO);
29 Jdb_trap_state_module::print_trap_state(unsigned cpu)
31 Jdb_entry_frame *ef = Jdb::entry_frame.cpu(cpu);
32 if (!Jdb::cpu_in_jdb(cpu) || !ef)
33 printf("CPU %u has not entered JDB\n", cpu);
36 printf("Registers of CPU %u (before entering JDB)\n", cpu);
42 Jdb_module::Action_code
43 Jdb_trap_state_module::action (int cmd, void *&argbuf, char const *&fmt, int &next)
45 char const *c = (char const *)argbuf;
54 Jdb::foreach_cpu(&print_trap_state);
55 else if (*c >= '0' && *c <= '9')
57 next = *c; argbuf = &cpu; fmt = "%i";
58 return EXTRA_INPUT_WITH_NEXTCHAR;
62 print_trap_state(cpu);
69 Jdb_trap_state_module::num_cmds() const
75 Jdb_module::Cmd const *
76 Jdb_trap_state_module::cmds() const
80 { { 0, "", "cpustate", "%C", "cpustate all|<cpunum>\tdump state of CPU", &c } };
86 Jdb_trap_state_module::Jdb_trap_state_module()