forked from Imagelibrary/binutils-gdb
* cli/cli-cmds.c (_initialize_cli_cmds): Remove "document",
"define", "while", and "if" commands. * cli/cli-script.c (while_command, if_command, define_command) (document_command): Now static. (_initialize_cli_script): New function. * cli/cli-script.h (while_command, if_command, define_command) (document_command): Don't declare.
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
2012-12-12 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* cli/cli-cmds.c (_initialize_cli_cmds): Remove "document",
|
||||||
|
"define", "while", and "if" commands.
|
||||||
|
* cli/cli-script.c (while_command, if_command, define_command)
|
||||||
|
(document_command): Now static.
|
||||||
|
(_initialize_cli_script): New function.
|
||||||
|
* cli/cli-script.h (while_command, if_command, define_command)
|
||||||
|
(document_command): Don't declare.
|
||||||
|
|
||||||
2012-12-12 Tom Tromey <tromey@redhat.com>
|
2012-12-12 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* cli/cli-cmds.c (_initialize_cli_cmds): New function.
|
* cli/cli-cmds.c (_initialize_cli_cmds): New function.
|
||||||
|
|||||||
@@ -1705,16 +1705,6 @@ use \"\\n\" if you want a newline to be printed.\n\
|
|||||||
Since leading and trailing whitespace are ignored in command arguments,\n\
|
Since leading and trailing whitespace are ignored in command arguments,\n\
|
||||||
if you want to print some you must use \"\\\" before leading whitespace\n\
|
if you want to print some you must use \"\\\" before leading whitespace\n\
|
||||||
to be printed or after trailing whitespace."));
|
to be printed or after trailing whitespace."));
|
||||||
add_com ("document", class_support, document_command, _("\
|
|
||||||
Document a user-defined command.\n\
|
|
||||||
Give command name as argument. Give documentation on following lines.\n\
|
|
||||||
End with a line of just \"end\"."));
|
|
||||||
add_com ("define", class_support, define_command, _("\
|
|
||||||
Define a new command name. Command name is argument.\n\
|
|
||||||
Definition appears on following lines, one command per line.\n\
|
|
||||||
End with a line of just \"end\".\n\
|
|
||||||
Use the \"document\" command to give documentation for the new command.\n\
|
|
||||||
Commands defined in this way may have up to ten arguments."));
|
|
||||||
|
|
||||||
add_setshow_enum_cmd ("script-extension", class_support,
|
add_setshow_enum_cmd ("script-extension", class_support,
|
||||||
script_ext_enums, &script_ext_mode, _("\
|
script_ext_enums, &script_ext_mode, _("\
|
||||||
@@ -1782,19 +1772,6 @@ the previous command number shown."),
|
|||||||
add_cmd ("version", no_set_class, show_version,
|
add_cmd ("version", no_set_class, show_version,
|
||||||
_("Show what version of GDB this is."), &showlist);
|
_("Show what version of GDB this is."), &showlist);
|
||||||
|
|
||||||
add_com ("while", class_support, while_command, _("\
|
|
||||||
Execute nested commands WHILE the conditional expression is non zero.\n\
|
|
||||||
The conditional expression must follow the word `while' and must in turn be\n\
|
|
||||||
followed by a new line. The nested commands must be entered one per line,\n\
|
|
||||||
and should be terminated by the word `end'."));
|
|
||||||
|
|
||||||
add_com ("if", class_support, if_command, _("\
|
|
||||||
Execute nested commands once IF the conditional expression is non zero.\n\
|
|
||||||
The conditional expression must follow the word `if' and must in turn be\n\
|
|
||||||
followed by a new line. The nested commands must be entered one per line,\n\
|
|
||||||
and should be terminated by the word 'else' or `end'. If an else clause\n\
|
|
||||||
is used, the same rules apply to its nested commands as to the first ones."));
|
|
||||||
|
|
||||||
/* If target is open when baud changes, it doesn't take effect until
|
/* If target is open when baud changes, it doesn't take effect until
|
||||||
the next open (I think, not sure). */
|
the next open (I think, not sure). */
|
||||||
add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
|
add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ execute_control_command_untraced (struct command_line *cmd)
|
|||||||
/* "while" command support. Executes a body of statements while the
|
/* "while" command support. Executes a body of statements while the
|
||||||
loop condition is nonzero. */
|
loop condition is nonzero. */
|
||||||
|
|
||||||
void
|
static void
|
||||||
while_command (char *arg, int from_tty)
|
while_command (char *arg, int from_tty)
|
||||||
{
|
{
|
||||||
struct command_line *command = NULL;
|
struct command_line *command = NULL;
|
||||||
@@ -622,7 +622,7 @@ while_command (char *arg, int from_tty)
|
|||||||
/* "if" command support. Execute either the true or false arm depending
|
/* "if" command support. Execute either the true or false arm depending
|
||||||
on the value of the if conditional. */
|
on the value of the if conditional. */
|
||||||
|
|
||||||
void
|
static void
|
||||||
if_command (char *arg, int from_tty)
|
if_command (char *arg, int from_tty)
|
||||||
{
|
{
|
||||||
struct command_line *command = NULL;
|
struct command_line *command = NULL;
|
||||||
@@ -1448,7 +1448,7 @@ user_defined_command (char *ignore, int from_tty)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
define_command (char *comname, int from_tty)
|
define_command (char *comname, int from_tty)
|
||||||
{
|
{
|
||||||
#define MAX_TMPBUF 128
|
#define MAX_TMPBUF 128
|
||||||
@@ -1565,7 +1565,7 @@ define_command (char *comname, int from_tty)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
document_command (char *comname, int from_tty)
|
document_command (char *comname, int from_tty)
|
||||||
{
|
{
|
||||||
struct command_line *doclines;
|
struct command_line *doclines;
|
||||||
@@ -1700,3 +1700,34 @@ show_user_1 (struct cmd_list_element *c, char *prefix, char *name,
|
|||||||
fputs_filtered ("\n", stream);
|
fputs_filtered ("\n", stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
initialize_file_ftype _initialize_cli_script;
|
||||||
|
|
||||||
|
void
|
||||||
|
_initialize_cli_script (void)
|
||||||
|
{
|
||||||
|
add_com ("document", class_support, document_command, _("\
|
||||||
|
Document a user-defined command.\n\
|
||||||
|
Give command name as argument. Give documentation on following lines.\n\
|
||||||
|
End with a line of just \"end\"."));
|
||||||
|
add_com ("define", class_support, define_command, _("\
|
||||||
|
Define a new command name. Command name is argument.\n\
|
||||||
|
Definition appears on following lines, one command per line.\n\
|
||||||
|
End with a line of just \"end\".\n\
|
||||||
|
Use the \"document\" command to give documentation for the new command.\n\
|
||||||
|
Commands defined in this way may have up to ten arguments."));
|
||||||
|
|
||||||
|
add_com ("while", class_support, while_command, _("\
|
||||||
|
Execute nested commands WHILE the conditional expression is non zero.\n\
|
||||||
|
The conditional expression must follow the word `while' and must in turn be\n\
|
||||||
|
followed by a new line. The nested commands must be entered one per line,\n\
|
||||||
|
and should be terminated by the word `end'."));
|
||||||
|
|
||||||
|
add_com ("if", class_support, if_command, _("\
|
||||||
|
Execute nested commands once IF the conditional expression is non zero.\n\
|
||||||
|
The conditional expression must follow the word `if' and must in turn be\n\
|
||||||
|
followed by a new line. The nested commands must be entered one per line,\n\
|
||||||
|
and should be terminated by the word 'else' or `end'. If an else clause\n\
|
||||||
|
is used, the same rules apply to its nested commands as to the first ones."));
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,14 +25,6 @@ struct cmd_list_element;
|
|||||||
|
|
||||||
extern void script_from_file (FILE *stream, const char *file);
|
extern void script_from_file (FILE *stream, const char *file);
|
||||||
|
|
||||||
extern void document_command (char *, int);
|
|
||||||
|
|
||||||
extern void define_command (char *, int);
|
|
||||||
|
|
||||||
extern void while_command (char *arg, int from_tty);
|
|
||||||
|
|
||||||
extern void if_command (char *arg, int from_tty);
|
|
||||||
|
|
||||||
extern void show_user_1 (struct cmd_list_element *c, char *prefix,
|
extern void show_user_1 (struct cmd_list_element *c, char *prefix,
|
||||||
char *name, struct ui_file *stream);
|
char *name, struct ui_file *stream);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user