diff options
author | Tom Tromey <tromey@redhat.com> | 2008-04-17 00:25:01 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2008-04-17 00:25:01 +0000 |
commit | 700b53b17a52448cb49f04a4e27d5f0130537924 (patch) | |
tree | c6c9be0bfe988471b3e3c8c23096b7669d8c202d /gdb/top.c | |
parent | f3c69fcab18257246fa945f4a85388b54a34e512 (diff) | |
download | gdb-700b53b17a52448cb49f04a4e27d5f0130537924.zip gdb-700b53b17a52448cb49f04a4e27d5f0130537924.tar.gz gdb-700b53b17a52448cb49f04a4e27d5f0130537924.tar.bz2 |
* cli/cli-decode.h (CMD_ASYNC_OK): New define.
(set_cmd_async_ok, get_cmd_async_ok): Declare.
* cli/cli-decode.c (set_cmd_async_ok): New function.
(get_cmd_async_ok): New function.
* cli/cli-cmds.c (init_cli_cmds): Mark "pwd", "help", "info", and
"show" as async-ok.
* top.c (execute_command): Use get_cmd_async_ok.
* infcmd.c: Include cli/cli-decode.h.
(_initialize_infcmd): Mark "interrupt" as async-ok.
* Makefile.in (infcmd.o): Depend on cli_decode_h.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -458,13 +458,8 @@ execute_command (char *p, int from_tty) /* If the target is running, we allow only a limited set of commands. */ - if (target_can_async_p () && target_executing) - if (strcmp (c->name, "help") != 0 - && strcmp (c->name, "pwd") != 0 - && strcmp (c->name, "show") != 0 - && strcmp (c->name, "info") != 0 - && strcmp (c->name, "interrupt") != 0) - error (_("Cannot execute this command while the target is running.")); + if (target_can_async_p () && target_executing && !get_cmd_async_ok (c)) + error (_("Cannot execute this command while the target is running.")); /* Pass null arg rather than an empty one. */ arg = *p ? p : 0; |