void (*validator)(char *, void *),
void *closure);
-static std::string insert_args (const char *line);
-
static struct cleanup * setup_user_args (char *p);
static char *read_next_line (void);
case simple_control:
{
/* A simple command, execute it and return. */
- std::string new_line = insert_args (cmd->line);
+ std::string new_line = insert_user_defined_cmd_args (cmd->line);
execute_command (&new_line[0], 0);
ret = cmd->control_type;
break;
print_command_trace (buffer);
/* Parse the loop control expression for the while statement. */
- std::string new_line = insert_args (cmd->line);
+ std::string new_line = insert_user_defined_cmd_args (cmd->line);
expression_up expr = parse_expression (new_line.c_str ());
ret = simple_control;
print_command_trace (buffer);
/* Parse the conditional for the if statement. */
- std::string new_line = insert_args (cmd->line);
+ std::string new_line = insert_user_defined_cmd_args (cmd->line);
expression_up expr = parse_expression (new_line.c_str ());
current = NULL;
{
/* Breakpoint commands list, record the commands in the
breakpoint's command list and return. */
- std::string new_line = insert_args (cmd->line);
+ std::string new_line = insert_user_defined_cmd_args (cmd->line);
ret = commands_from_control_command (new_line.c_str (), cmd);
break;
}
return NULL;
}
-/* Insert the user defined arguments stored in user_arg into the $arg
- arguments found in line. */
+/* See cli-script.h. */
-static std::string
-insert_args (const char *line)
+std::string
+insert_user_defined_cmd_args (const char *line)
{
- /* If we are not in a user-defined function, treat $argc, $arg0, et
+ /* If we are not in a user-defined command, treat $argc, $arg0, et
cetera as normal convenience variables. */
if (user_args == NULL)
return line;