return c;
}
+int unregister_all_commands(command_context_t *context)
+{
+ command_t *c, *c2;
+
+ unique_length_dirty = 1;
+
+ if (context == NULL)
+ return ERROR_OK;
+
+
+ while(NULL != context->commands)
+ {
+ c = context->commands;
+
+ while(NULL != c->children)
+ {
+ c2 = c->children;
+ c->children = c->children->next;
+ free(c2->name);
+ c2->name = NULL;
+ free(c2->help);
+ c2->help = NULL;
+ free(c2);
+ c2 = NULL;
+ }
+
+ context->commands = context->commands->next;
+
+ free(c->name);
+ c->name = NULL;
+ free(c->help);
+ c->help = NULL;
+ free(c);
+ c = NULL;
+ }
+
+ return ERROR_OK;
+}
+
int unregister_command(command_context_t *context, char *name)
{
command_t *c, *p = NULL, *c2;
{
command_print(context, "Syntax error:");
command_print_help_line(context, c, 0);
- } else if (retval != ERROR_OK)
+ }
+ else if (retval == ERROR_COMMAND_CLOSE_CONNECTION)
+ {
+ /* just fall through for a shutdown request */
+ }
+ else if (retval != ERROR_OK)
{
/* we do not print out an error message because the command *should*
* have printed out an error
char *words[128] = {0};
int retval;
int i;
+
+ LOG_USER_N("%s", ""); /* Keep GDB connection alive*/
if ((!context) || (!line))
return ERROR_INVALID_ARGUMENTS;
return command_print_help_match(context, context->commands, name, args, argc);
}
-
void command_set_output_handler(command_context_t* context, int (*output_handler)(struct command_context_s *context, char* line), void *priv)
{
context->output_handler = output_handler;