summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-03-17 19:53:39 +0000
committerAndrew Cagney <cagney@redhat.com>2002-03-17 19:53:39 +0000
commitd819b30711c6f178ec5c69b3ba7bcf14b50cbe28 (patch)
tree937007d3b95310f3d29080dec4ad74d104a2d018 /gdb/top.c
parent6e59db7f643dc3aaa30e2ea353ba8e29c7ca4508 (diff)
downloadgdb-d819b30711c6f178ec5c69b3ba7bcf14b50cbe28.tar.gz
* command.h: (execute_cmd_post_hook): Declare.
(execute_cmd_pre_hook): Declare. * cli/cli-script.c (clear_hook_in_cleanup): New function. (execute_cmd_post_hook, execute_cmd_pre_hook): New functions. Execute pre/post hook while ensuring that afterwords hook_in is cleared. * top.c (execute_command): Use execute_cmd_post_hook, and execute_cmd_pre_hook to execute pre/post commands. * infrun.c (normal_stop): Pass stop_command and not pre_hook to hook_stop_stub. (hook_stop_stub): Call execute_cmd_pre_hook.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 16d590fa7d8..83c84413c26 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -693,12 +693,7 @@ execute_command (char *p, int from_tty)
}
/* If this command has been pre-hooked, run the hook first. */
- if ((c->hook_pre) && (!c->hook_in))
- {
- c->hook_in = 1; /* Prevent recursive hooking */
- execute_user_command (c->hook_pre, (char *) 0);
- c->hook_in = 0; /* Allow hook to work again once it is complete */
- }
+ execute_cmd_pre_hook (c);
if (c->flags & DEPRECATED_WARN_USER)
deprecated_cmd_warning (&line);
@@ -715,12 +710,7 @@ execute_command (char *p, int from_tty)
(*c->func) (c, arg, from_tty & caution);
/* If this command has been post-hooked, run the hook last. */
- if ((c->hook_post) && (!c->hook_in))
- {
- c->hook_in = 1; /* Prevent recursive hooking */
- execute_user_command (c->hook_post, (char *) 0);
- c->hook_in = 0; /* allow hook to work again once it is complete */
- }
+ execute_cmd_post_hook (c);
}