diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-03-17 19:53:39 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-03-17 19:53:39 +0000 |
commit | 5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6 (patch) | |
tree | 3a71d9fbb8b638a854b285a146da693cbe2a903e /gdb/infrun.c | |
parent | b51450c9ff9fe4a30bdc760802e69d313345c838 (diff) | |
download | gdb-5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6.zip gdb-5913bcb0f6f0e0b63bdbb528cadd0de6887bf7a6.tar.gz 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/infrun.c')
-rw-r--r-- | gdb/infrun.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 6ae8f7c..466305f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3414,13 +3414,11 @@ and/or watchpoints.\n"); target_terminal_ours (); - /* Look up the hook_stop and run it if it exists. */ - - if (stop_command && stop_command->hook_pre) - { - catch_errors (hook_stop_stub, stop_command->hook_pre, - "Error while running hook_stop:\n", RETURN_MASK_ALL); - } + /* Look up the hook_stop and run it (CLI internally handles problem + of stop_command's pre-hook not existing). */ + if (stop_command) + catch_errors (hook_stop_stub, stop_command, + "Error while running hook_stop:\n", RETURN_MASK_ALL); if (!target_has_stack) { @@ -3521,7 +3519,7 @@ done: static int hook_stop_stub (void *cmd) { - execute_user_command ((struct cmd_list_element *) cmd, 0); + execute_cmd_pre_hook ((struct cmd_list_element *) cmd); return (0); } |