From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9597 invoked by alias); 30 Aug 2004 16:58:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9590 invoked from network); 30 Aug 2004 16:58:42 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 30 Aug 2004 16:58:42 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i7UGwbS2026593 for ; Mon, 30 Aug 2004 12:58:37 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i7UGwZ319005; Mon, 30 Aug 2004 12:58:35 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 720AD2B9D; Mon, 30 Aug 2004 12:57:26 -0400 (EDT) Message-ID: <41335C76.6050803@gnu.org> Date: Mon, 30 Aug 2004 16:58:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040801 MIME-Version: 1.0 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Fix step/next across signals References: <412F5557.3000700@redhat.com> In-Reply-To: <412F5557.3000700@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00769.txt.bz2 I've checked this in. Andrew > Hello, > > The attached fixes a bug with step/next across signals. Given: > > Breakpoint at 10 hit > 10 while (!done); > (gdb) next > > when there was a signal pending (that set DONE), GDB would: > > Attempt to step of the breakpoint at "10": > - pull all breakpoints > - PT_STEP (to get off the BP instruction) > - get back the signal instead > > Attempt to skip the signal handler: > - add a step_resume_breakpoint at "10" the signal return addr > - PT_STEP delivering the signal > - insert all breakpoints (including step_resume) > - PT_CONTINUE the inferior > - get back SIGTRAP from the step_resume breakpoint > - delete the step_resume bp > > Go back to doing the next: > - PT_STEP the inferior (breakpoints including "10" still inserted) > - re-hit "10" > > the problem is that GDB forgot that it was, at the time of the signal, trying to step off a breakpoint. > > The attached patch fixes this, it notes if/when it was stepping off a breakpoint, so that it can return to that task once the step-resume-breakpoint is hit. > > I've tested it on a my patched PPC/NetBSD kernel and it KPASSes 1757; and a vanila rhel3u2 system with no test changes. > > Since the 1757 KFAILs pass, I've removed them as `obvious'. > > comments? > Andrew > > > > Index: testsuite/ChangeLog > 2004-08-26 Andrew Cagney > > * gdb.base/sigstep.exp (breakpoint_over_handler): Remove kfail > gdb/1757. > > Index: ChangeLog > 2004-08-26 Andrew Cagney > > Fix PR breakpoints/1757. > * infrun.c (struct execution_control_state): Replace > remove_breakpoints_on_following_step with > step_after_step_resume_breakpoint. > (init_execution_control_state): Update. > (handle_inferior_event): For signals, when stepping off a > breakpoint, set step_after_step_resume_breakpoint. When > BPSTAT_WHAT_STEP_RESUME, do a single-step off the breakpoint. > (keep_going): Delete code handling > remove_breakpoints_on_following_step. >