#include <jdb_module.h>
Inheritance diagram for Jdb_module:
Public Types | |
typedef void( | Gotkey )(char *&str, int maxlen, int c) |
enum | Action_code { NOTHING = 0, LEAVE, GO_BACK, ERROR, EXTRA_INPUT, EXTRA_INPUT_WITH_NEXTCHAR } |
Possible return codes from action(). More... | |
Public Member Functions | |
Jdb_module (char const *category="MISC") FIASCO_INIT | |
Create a new instance of an Jdb_module. | |
virtual | ~Jdb_module () |
dtor | |
virtual Action_code | action (int cmd, void *&args, char const *&fmt, int &next_char)=0 |
The actual handler of the module. | |
virtual int const | num_cmds () const =0 |
The number of commands this modules provides. | |
virtual Cmd const *const | cmds () const =0 |
The commands this module provides. | |
Jdb_category const * | category () const |
Get the category of this module. | |
Jdb_module * | next () const |
Get the next registered Jdb_module. | |
Cmd const * | has_cmd (char const *cmd, bool short_mode=false) const |
Get Cmd structure according to cmd. | |
Static Public Member Functions | |
static Jdb_module * | first () |
Get the first registered Jdb_module. | |
Private Attributes | |
Jdb_module * | _next |
Jdb_module * | _prev |
Jdb_category const *const | _cat |
Static Private Attributes | |
static Jdb_module * | _first = 0 |
Classes | |
struct | Cmd |
A Jdb command description. More... |
This class is the base for any module of the modularized Jdb. Ths idea is that Jdb can be extended by plugging in a new module, which provides one ore more commands and their implementations to Jdb.
A new module can be created by deriving from Jdb_module and providing the neccessary methods (num_cmds, cmds, action, and maybe the constructor). To plug the module into Jdb a static instance of the module must be created, with "INIT_PRIORITY(JDB_MODULE_INIT_PRIO)".
|
|
|
Possible return codes from action(). The actual handler of the Jdb_module (action()) may return any value of this type.
|
|
Create a new instance of an Jdb_module.
|
|
dtor
|
|
The actual handler of the module.
The args and fmt arguments are references because they may be modified by the action() method and extra input may be requested by returning Action_code::EXTRA_INPUT. In the case where Action_code::EXTRA_INPUT is returned the Jdb_core reads again the values according to the given format (fmt) and enters action(). With this mechanism it is possible to request further input depending on the already given input. Implemented in Jdb_attach_irq, Jdb_set_bp, Jdb_bt, Jdb_cb, Go_m, Help_m, Jdb_counters, Jdb_disasm, Jdb_dump, Jdb_exit_module, Jdb_halt_thread, Io_m, Jdb_iomap, Jdb_kern_info, Jdb_mapdb, Jdb_misc_general, Jdb_misc_debug, Jdb_misc_info, Jdb_misc_monitor, Jdb_pcm, Jdb_ptab_m, Jdb_tbuf_show, Jdb_tcb, Jdb_list_threads, Jdb_list_timeouts, and Jdb_set_trace. |
|
Get the category of this module.
|
|
The commands this module provides. An array of Cmd structures must be returned, where each entry describes a single command. The command IDs (see Cmd::id) should be unique within the module, so that action() can distinguish between the different commands.
Implemented in Jdb_attach_irq, Jdb_set_bp, Jdb_bt, Jdb_cb, Go_m, Help_m, Jdb_counters, Jdb_disasm, Jdb_dump, Jdb_exit_module, Jdb_halt_thread, Io_m, Jdb_iomap, Jdb_kern_info, Jdb_mapdb, Jdb_misc_general, Jdb_misc_debug, Jdb_misc_info, Jdb_misc_monitor, Jdb_pcm, Jdb_ptab_m, Jdb_tbuf_show, Jdb_tcb, Jdb_list_threads, Jdb_list_timeouts, and Jdb_set_trace. |
|
Get the first registered Jdb_module.
|
|
Get Cmd structure according to cmd.
|
|
Get the next registered Jdb_module.
|
|
The number of commands this modules provides. This method must return how many Cmd structures can be found in the array returned by cmds().
Implemented in Jdb_attach_irq, Jdb_set_bp, Jdb_bt, Jdb_cb, Go_m, Help_m, Jdb_counters, Jdb_disasm, Jdb_dump, Jdb_exit_module, Jdb_halt_thread, Io_m, Jdb_iomap, Jdb_kern_info, Jdb_mapdb, Jdb_misc_general, Jdb_misc_debug, Jdb_misc_info, Jdb_misc_monitor, Jdb_pcm, Jdb_ptab_m, Jdb_tbuf_show, Jdb_tcb, Jdb_list_threads, Jdb_list_timeouts, and Jdb_set_trace. |
|
|
|
Reimplemented in Jdb_kern_info. |
|
|
|
|