From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1036 invoked by alias); 16 Mar 2014 03:41:59 -0000 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 Received: (qmail 1019 invoked by uid 89); 16 Mar 2014 03:41:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f178.google.com Received: from mail-yk0-f178.google.com (HELO mail-yk0-f178.google.com) (209.85.160.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 16 Mar 2014 03:41:54 +0000 Received: by mail-yk0-f178.google.com with SMTP id 79so11358933ykr.9 for ; Sat, 15 Mar 2014 20:41:51 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.236.94.197 with SMTP id n45mr24290239yhf.46.1394941311733; Sat, 15 Mar 2014 20:41:51 -0700 (PDT) Received: by 10.170.214.130 with HTTP; Sat, 15 Mar 2014 20:41:51 -0700 (PDT) In-Reply-To: <1394154640-14053-3-git-send-email-palves@redhat.com> References: <1394154640-14053-1-git-send-email-palves@redhat.com> <1394154640-14053-3-git-send-email-palves@redhat.com> Date: Sun, 16 Mar 2014 03:41:00 -0000 Message-ID: Subject: Re: [PATCH v3 2/5] PR breakpoints/7143 - Watchpoint does not trigger when first set From: Doug Evans To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00347.txt.bz2 On Thu, Mar 6, 2014 at 5:10 PM, Pedro Alves wrote: > [...] > gdb/ > 2014-03-06 Pedro Alves > > PR breakpoints/7143 > * breakpoint.c (should_be_inserted): Don't insert breakpoints that > are being stepped over. > (breakpoint_address_match): Make extern. > * breakpoint.h (breakpoint_address_match): New declaration. > * inferior.h (stepping_past_instruction_at): New declaration. > * infrun.c (struct step_over_info): New type. > (step_over_info): New global. > (set_step_over_info, clear_step_over_info) > (stepping_past_instruction_at): New functions. > (handle_inferior_event): Clear the step-over info when > trap_expected is cleared. > (resume): Remove now stale comment. > (clear_proceed_status): Clear step-over info. > (proceed): Adjust step-over handling to set or clear the step-over > info instead of removing all breakpoints. > (handle_signal_stop): When setting up a thread-hop, don't remove > breakpoints here. > (stop_stepping): Clear step-over info. > (keep_going): Adjust step-over handling to set or clear step-over > info and then always inserting breakpoints, instead of removing > all breakpoints when stepping over one. > > gdb/testsuite/ > 2014-03-06 Pedro Alves > > PR breakpoints/7143 > * gdb.base/watchpoint.exp: Mention bugzilla bug number instead of > old gnats gdb/38. Remove kfail. Adjust to use gdb_test instead > of gdb_test_multiple. > * gdb.cp/annota2.exp: Remove kfail for gdb/38. > * gdb.cp/annota3.exp: Remove kfail for gdb/38. Hi. Ok by me with one nit. I do like the functions that set/clear the step-over info. > [...] > diff --git a/gdb/infrun.c b/gdb/infrun.c > index bd55505..b7c02d7 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -977,6 +977,76 @@ static CORE_ADDR singlestep_pc; > static ptid_t saved_singlestep_ptid; > static int stepping_past_singlestep_breakpoint; > > +/* Info about an instruction that is being stepped over. Invalid if > + ASPACE is NULL. */ > + > +struct step_over_info > +{ > + /* The instruction's address space. */ > + struct address_space *aspace; > + > + /* The instruction's address. */ > + CORE_ADDR address; > +}; > + > +/* The step-over info of the location that is being stepped over. > + > + Note that with async/breakpoint always-inserted mode, a user might > + set a new breakpoint/watchpoint/etc. exactly while a breakpoint is > + being stepped over. As setting a new breakpoint inserts all > + breakpoints, we need to make sure the breakpoint being stepped over > + isn't inserted then. We do that by only clearing the step-over > + info when the step-over is actually finished (or aborted). > + > + Presently GDB can only step over a breakpoint at any given time. I realize this is nitpicky, but can you reword this as: Presently GDB can only step over one breakpoint at any given time. I realize it's saying the same thing, but when I first read it I had to read it a couple of times to make sure I read it right. Maybe it's just me.