* Allow up to 10 whitespace separated arguments to user defined

commands.
        * top.c (struct user_args): Structure for holding arguments to
        user defined commands.
        (print_command_line): Delete unused "tmp_chain" variable.  Clean
        up flow control by having cases exit in the same manner.
        Before executing a command or evaluating an expression, substitute
        the current $arg0..$arg9 values if the command/expression uses them.
        (arg_cleanup): New function.
        (setup_user_args, locate_arg, insert_args): Likewise.
        (execute_user_command): Allow arguments to user defined commands.

        * Allow if/while commands to be used within a breakpoint command
        list.
        * breakpoint.c (bpstat_do_actions): Call execute_control_command
        rather than execute_command (passes entire command structure rather
        than just the command line text).
        (breakpoint_1): Use "print_command_line" to print a breakpoint
        command line (including control structures).
        * gdbcmd.h (execute_control_command): Provide extern decl.
        (print_command_line): Likewise.
        * top.c (execute_control_command): No longer static.
        (print_command_line): New function to recursively print a command
        line, including control structures.
This commit is contained in:
Jeff Law
1994-12-30 19:53:39 +00:00
parent 15edf5253b
commit 0f8cdd9ba4
4 changed files with 314 additions and 22 deletions

View File

@@ -947,9 +947,9 @@ top:
{
while (bs->commands)
{
char *line = bs->commands->line;
struct command_line *cmd = bs->commands;
bs->commands = bs->commands->next;
execute_command (line, 0);
execute_control_command (cmd);
/* If the inferior is proceeded by the command, bomb out now.
The bpstat chain has been blown away by wait_for_inferior.
But since execution has stopped again, there is a new bpstat
@@ -1793,9 +1793,7 @@ breakpoint_1 (bnum, allflag)
while (l)
{
fputs_filtered ("\t", gdb_stdout);
fputs_filtered (l->line, gdb_stdout);
fputs_filtered ("\n", gdb_stdout);
print_command_line (l, 4);
l = l->next;
}
}