2008-03-14 Pedro Alves * top.c (bpstat_do_actions_wrapper): New. (command_line_handler_continuation): Wrap call to bpstat_do_actions in catch_errors. --- gdb/top.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) Index: src/gdb/top.c =================================================================== --- src.orig/gdb/top.c 2008-03-14 07:10:51.000000000 +0000 +++ src/gdb/top.c 2008-03-14 07:22:10.000000000 +0000 @@ -364,6 +364,14 @@ do_chdir_cleanup (void *old_dir) } #endif +static int +bpstat_do_actions_wrapper (void *arg) +{ + bpstat *bsp = arg; + bpstat_do_actions (bsp); + return 1; +} + /* Do any commands attached to breakpoint we stopped at. Only if we are always running synchronously. Or if we have just executed a command that doesn't start the target. */ @@ -376,7 +384,12 @@ command_line_handler_continuation (struc long time_at_cmd_start = arg->data.longint; long space_at_cmd_start = arg->next->data.longint; - bpstat_do_actions (&stop_bpstat); + /* Don't let exceptions escape into + inferior_event_handler/INF_REG_EVENT, as that pops the + target. */ + catch_errors (bpstat_do_actions_wrapper, (void *) &stop_bpstat, + "", RETURN_MASK_ALL); + /*do_cleanups (old_chain); *//*?????FIXME????? */ if (display_time) @@ -542,7 +555,7 @@ execute_command (char *p, int from_tty) } } - /* Set things up for this function to be compete later, once the + /* Set things up for this function to be finished later, once the execution has completed, if we are doing an execution command, otherwise, just go ahead and finish. */ if (target_can_async_p () && target_executing)