mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 21:03:55 +08:00
2002-07-03 Martin M. Hunt <hunt@redhat.com>
* top.c (execute_command): Use cmd_func() and cmd_func_p(). * cli/cli-decode.c (cmd_func_p): New function. (cmd_func): New function. * command.h: Add cmd_func() and cmd_func_p().
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2002-07-03 Martin M. Hunt <hunt@redhat.com>
|
||||||
|
|
||||||
|
* top.c (execute_command): Use cmd_func() and cmd_func_p().
|
||||||
|
|
||||||
|
* cli/cli-decode.c (cmd_func_p): New function.
|
||||||
|
(cmd_func): New function.
|
||||||
|
|
||||||
|
* command.h: Add cmd_func() and cmd_func_p().
|
||||||
|
|
||||||
2002-07-03 Grace Sainsbury <graces@redhat.com>
|
2002-07-03 Grace Sainsbury <graces@redhat.com>
|
||||||
|
|
||||||
* config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Add macro. Set to 0.
|
* config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Add macro. Set to 0.
|
||||||
|
@ -1505,3 +1505,23 @@ complete_on_enum (const char *enumlist[],
|
|||||||
return matchlist;
|
return matchlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* check function pointer */
|
||||||
|
int
|
||||||
|
cmd_func_p (struct cmd_list_element *cmd)
|
||||||
|
{
|
||||||
|
return (cmd->func != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* call the command function */
|
||||||
|
void
|
||||||
|
cmd_func (struct cmd_list_element *cmd, char *args, int from_tty)
|
||||||
|
{
|
||||||
|
if (cmd_func_p (cmd))
|
||||||
|
(*cmd->func) (cmd, args, from_tty);
|
||||||
|
else
|
||||||
|
error ("Invalid command");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,4 +280,10 @@ extern void dont_repeat (void);
|
|||||||
|
|
||||||
extern void not_just_help_class_command (char *, int);
|
extern void not_just_help_class_command (char *, int);
|
||||||
|
|
||||||
|
/* check function pointer */
|
||||||
|
extern int cmd_func_p (struct cmd_list_element *cmd);
|
||||||
|
|
||||||
|
/* call the command function */
|
||||||
|
extern void cmd_func (struct cmd_list_element *cmd, char *args, int from_tty);
|
||||||
|
|
||||||
#endif /* !defined (COMMAND_H) */
|
#endif /* !defined (COMMAND_H) */
|
||||||
|
@ -703,12 +703,12 @@ execute_command (char *p, int from_tty)
|
|||||||
execute_user_command (c, arg);
|
execute_user_command (c, arg);
|
||||||
else if (c->type == set_cmd || c->type == show_cmd)
|
else if (c->type == set_cmd || c->type == show_cmd)
|
||||||
do_setshow_command (arg, from_tty & caution, c);
|
do_setshow_command (arg, from_tty & caution, c);
|
||||||
else if (c->func == NULL)
|
else if (!cmd_func_p (c))
|
||||||
error ("That is not a command, just a help topic.");
|
error ("That is not a command, just a help topic.");
|
||||||
else if (call_command_hook)
|
else if (call_command_hook)
|
||||||
call_command_hook (c, arg, from_tty & caution);
|
call_command_hook (c, arg, from_tty & caution);
|
||||||
else
|
else
|
||||||
(*c->func) (c, arg, from_tty & caution);
|
cmd_func (c, arg, from_tty & caution);
|
||||||
|
|
||||||
/* If this command has been post-hooked, run the hook last. */
|
/* If this command has been post-hooked, run the hook last. */
|
||||||
execute_cmd_post_hook (c);
|
execute_cmd_post_hook (c);
|
||||||
|
Reference in New Issue
Block a user