From patchwork Fri Oct 3 13:54:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 3084 Received: (qmail 17887 invoked by alias); 3 Oct 2014 13:54:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17867 invoked by uid 89); 3 Oct 2014 13:54:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 03 Oct 2014 13:54:22 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s93DsLoN000604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 3 Oct 2014 09:54:21 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s93DsJ7Z025501 for ; Fri, 3 Oct 2014 09:54:20 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 1/8] Decide whether we may have removed breakpoints based on step_over_info Date: Fri, 3 Oct 2014 14:54:11 +0100 Message-Id: <1412344458-31774-2-git-send-email-palves@redhat.com> In-Reply-To: <1412344458-31774-1-git-send-email-palves@redhat.com> References: <1412344458-31774-1-git-send-email-palves@redhat.com> ... instead of trap_expected. Gets rid of one singlestep_breakpoints_inserted_p reference, and is generally more to the point. gdb/ 2014-10-03 Pedro Alves * infrun.c (step_over_info_valid_p): New function. (resume): Use step_over_info_valid_p instead of checking the threads's trap_expected flag. --- gdb/infrun.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 8137eb3..9875183 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1279,6 +1279,14 @@ stepping_past_instruction_at (struct address_space *aspace, step_over_info.address)); } +/* Returns true if step-over info is valid. */ + +static int +step_over_info_valid_p (void) +{ + return (step_over_info.aspace != NULL); +} + /* Displaced stepping. */ @@ -2144,7 +2152,8 @@ a command like `return' or `jump' to continue execution.")); once we arrive back at the step-resume breakpoint, actually step over the breakpoint we originally wanted to step over. */ if (singlestep_breakpoints_inserted_p - && tp->control.trap_expected && sig != GDB_SIGNAL_0) + && sig != GDB_SIGNAL_0 + && step_over_info_valid_p ()) { /* If we have nested signals or a pending signal is delivered immediately after a handler returns, might might already have @@ -2238,13 +2247,10 @@ a command like `return' or `jump' to continue execution.")); tp->suspend.stop_signal = GDB_SIGNAL_0; /* Advise target which signals may be handled silently. If we have - removed breakpoints because we are stepping over one (which can - happen only if we are not using displaced stepping), we need to - receive all signals to avoid accidentally skipping a breakpoint - during execution of a signal handler. */ - if ((step || singlestep_breakpoints_inserted_p) - && tp->control.trap_expected - && !use_displaced_stepping (gdbarch)) + removed breakpoints because we are stepping over one (in any + thread), we need to receive all signals to avoid accidentally + skipping a breakpoint during execution of a signal handler. */ + if (step_over_info_valid_p ()) target_pass_signals (0, NULL); else target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass);