From 91b9f3de0b8e3277ab5c584c6076ddfe491ffc86 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Mon, 3 May 2010 17:01:53 +0200 Subject: command context: fix errors when running certain commands on startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/helper/command.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/helper/command.h') diff --git a/src/helper/command.h b/src/helper/command.h index 8a418d36..2c192416 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -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 -- cgit v1.2.3