diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-07-05 17:58:44 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-07-05 17:58:44 +0000 |
commit | 43ff13b4182f3853e19e9100c84313a6e9302b70 (patch) | |
tree | a546b011131cdb9e4d6200dd1f2b9432ffa01539 /gdb/top.c | |
parent | f11523b01363bac4f0b7384c30fee355e9943b99 (diff) | |
download | gdb-43ff13b4182f3853e19e9100c84313a6e9302b70.zip gdb-43ff13b4182f3853e19e9100c84313a6e9302b70.tar.gz gdb-43ff13b4182f3853e19e9100c84313a6e9302b70.tar.bz2 |
import gdb-1999-07-05 snapshot
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -322,6 +322,12 @@ int remote_timeout = 20; /* Set default to 20 */ int remote_debug = 0; +/* Non-zero means the target is running. Note: this is different from + saying that there is an active target and we are stopped at a + breakpoint, for instance. This is a real indicator whether the + target is off and running, which gdb is doing something else. */ +int target_executing = 0; + /* Level of control structure. */ static int control_level; @@ -383,11 +389,6 @@ void (*command_loop_hook) PARAMS ((void)); void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer, GDB_FILE *stream)); -/* Called when the target says something to the host, which may - want to appear in a different window. */ - -void (*target_output_hook) PARAMS ((char *)); - /* Called from print_frame_info to list the line we stopped in. */ void (*print_frame_info_listing_hook) PARAMS ((struct symtab *s, int line, @@ -486,6 +487,8 @@ return_to_top_level (reason) disable_current_display (); do_cleanups (ALL_CLEANUPS); + if (async_p && target_has_async) + do_exec_cleanups (ALL_CLEANUPS); if (annotation_level > 1) switch (reason) @@ -1266,6 +1269,16 @@ execute_command (p, from_tty) char *arg; c = lookup_cmd (&p, cmdlist, "", 0, 1); + + /* If the target is running, we allow only a limited set of + commands. */ + if (async_p && target_has_async && target_executing) + if (!strcmp (c->name, "help") + && !strcmp (c->name, "pwd") + && !strcmp (c->name, "show") + && !strcmp (c->name, "stop")) + error ("Cannot execute this command while the target is running."); + /* Pass null arg rather than an empty one. */ arg = *p ? p : 0; |