aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.h
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
commit5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6 (patch)
tree3a71d9fbb8b638a854b285a146da693cbe2a903e /gdb/command.h
parentb51450c9ff9fe4a30bdc760802e69d313345c838 (diff)
downloadfsf-binutils-gdb-5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6.zip
fsf-binutils-gdb-5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6.tar.gz
fsf-binutils-gdb-5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6.tar.bz2
* 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/command.h')
-rw-r--r--gdb/command.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/command.h b/gdb/command.h
index bebf6eb..58574f4 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -300,6 +300,12 @@ extern void set_cmd_completer (struct cmd_list_element *cmd,
extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
void (*cfunc) (char *args, int from_tty));
+/* Execute CMD's pre/post hook. Throw an error if the command fails.
+ If already executing this pre/post hook, or there is no pre/post
+ hook, the call is silently ignored. */
+extern void execute_cmd_pre_hook (struct cmd_list_element *cmd);
+extern void execute_cmd_post_hook (struct cmd_list_element *cmd);
+
extern struct cmd_list_element *lookup_cmd (char **,
struct cmd_list_element *, char *,
int, int);