mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 11:04:18 +08:00
80a65e9b8f
When using "if" (or while) without args directly on gdb's command line, you get this: (gdb) if if/while commands require arguments When doing the same when entering a command list, you only get an error when the command is executed, when parse_exp_in_context_1 fails to evaluate the expression. (gdb) define foo Type commands for definition of "foo". End with a line saying just "end". >if >end >end (gdb) foo Argument required (expression to compute). I think it would make more sense to error out when inputting the command list directly: (gdb) define foo Type commands for definition of "foo". End with a line saying just "end". >if if/while commands require arguments. The only required change is to check whether args is an empty string in build_command_line. gdb/ChangeLog: * cli/cli-script.c (build_command_line): For if/while commands, check whether args is empty. gdb/testsuite/ChangeLog: * gdb.base/commands.exp: Call new procedure. (define_if_without_arg_test): New procedure. |
||
---|---|---|
.. | ||
cli-cmds.c | ||
cli-cmds.h | ||
cli-decode.c | ||
cli-decode.h | ||
cli-dump.c | ||
cli-interp.c | ||
cli-interp.h | ||
cli-logging.c | ||
cli-script.c | ||
cli-script.h | ||
cli-setshow.c | ||
cli-setshow.h | ||
cli-utils.c | ||
cli-utils.h |