command context: fix errors when running certain commands on startup

Various commands, e.g. "arm mcr xxxx" would fail if invoked upon startup
since it there was no command context defined for the jim interpreter
in that case.

A Jim interpreter is now associated with a command context(telnet,
gdb server's) or the default global command context.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe
2010-05-03 17:01:53 +02:00
parent 7e33f87b3d
commit 91b9f3de0b
5 changed files with 30 additions and 23 deletions

View File

@@ -311,6 +311,10 @@ void command_set_output_handler(struct command_context* context,
int command_context_mode(struct command_context *context, enum command_mode mode);
/* Return the current command context associated with the Jim interpreter or
* alternatively the global default command interpreter
*/
struct command_context *current_command_context(Jim_Interp *interp);
/**
* Creates a new command context using the startup TCL provided and
* the existing Jim interpreter, if any. If interp == NULL, then command_init