From patchwork Fri Sep 26 00:39:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 2977 Received: (qmail 10553 invoked by alias); 26 Sep 2014 00:39:48 -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 10532 invoked by uid 89); 26 Sep 2014 00:39:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS 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, 26 Sep 2014 00:39:47 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8Q0djTH016266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 25 Sep 2014 20:39:45 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8Q0dgF9019425 for ; Thu, 25 Sep 2014 20:39:45 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/9] Decide whether we may have removed breakpoints based on step_over_info Date: Fri, 26 Sep 2014 01:39:34 +0100 Message-Id: <1411691982-10744-2-git-send-email-palves@redhat.com> In-Reply-To: <1411691982-10744-1-git-send-email-palves@redhat.com> References: <1411691982-10744-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-09-22 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. Add debug output. --- gdb/infrun.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 5e123be..6c8296d 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1038,6 +1038,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. */ @@ -1903,7 +1911,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 @@ -1997,13 +2006,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 + removed breakpoints because we are stepping over one, 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)) + if (step_over_info_valid_p ()) target_pass_signals (0, NULL); else target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass);