From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6607 invoked by alias); 24 Apr 2008 16:02:15 -0000 Received: (qmail 6598 invoked by uid 22791); 24 Apr 2008 16:02:15 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 24 Apr 2008 16:01:57 +0000 Received: (qmail 10907 invoked from network); 24 Apr 2008 16:01:55 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Apr 2008 16:01:55 -0000 From: Vladimir Prus Date: Thu, 24 Apr 2008 19:08:00 -0000 Subject: [RFA] bpstat_do_actions in one place To: gdb-patches@sources.redhat.com X-TUID: 8be9eab1b423ca6d X-Length: 1647 X-UID: 162 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804242002.03590.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00560.txt.bz2 This patch, to be applied on top of the "Use observers to report stop events." make async code call bpstat_do_action in the event handler, to make sure that it's always called. OK? - Volodya --- gdb/inf-loop.c | 7 +++++++ gdb/top.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index 4c61dae..3b18abb 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -43,6 +43,7 @@ void inferior_event_handler (enum inferior_event_type event_type, gdb_client_data client_data) { + struct gdb_exception e; int was_sync = 0; switch (event_type) { @@ -91,6 +92,12 @@ inferior_event_handler (enum inferior_event_type event_type, was_sync = sync_execution; async_enable_stdin (); + /* If there's an error doing breakpoint commands, we don't + want to throw -- continuation might still do something. */ + TRY_CATCH (e, RETURN_MASK_ERROR) + { + bpstat_do_actions (&stop_bpstat); + } /* If we were doing a multi-step (eg: step n, next n), but it got interrupted by a breakpoint, still do the pending continuations. The continuation itself is responsible for diff --git a/gdb/top.c b/gdb/top.c index 2454d24..feefcf0 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -379,8 +379,6 @@ command_line_handler_continuation (struct continuation_arg *arg, int error) if (error) return; - bpstat_do_actions (&stop_bpstat); - if (display_time) { long cmd_time = get_run_time () - time_at_cmd_start; -- 1.5.3.5