From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29142 invoked by alias); 10 Mar 2008 21:09:21 -0000 Received: (qmail 29130 invoked by uid 22791); 10 Mar 2008 21:09:20 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 10 Mar 2008 21:08:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 93A96983B5; Mon, 10 Mar 2008 21:08:45 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 5C5399801D; Mon, 10 Mar 2008 21:08:45 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JYpEi-0000iU-OF; Mon, 10 Mar 2008 17:08:44 -0400 Date: Mon, 10 Mar 2008 21:09:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Keep breakpoints always inserted. Message-ID: <20080310210844.GB14908@caradoc.them.org> Mail-Followup-To: Vladimir Prus , gdb-patches@sources.redhat.com References: <200802281717.14766.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200802281717.14766.vladimir@codesourcery.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes 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-03/txt/msg00109.txt.bz2 On Thu, Feb 28, 2008 at 05:17:13PM +0300, Vladimir Prus wrote: > > This is hopefully final revision of my patch to keep > breakpoints always inserted, which is needed to support > non-stop mode. A new variable 'breakpoint always-inserted' > is introduced that enables this mode. When enabled, > breakpoints are inserted into target immediately when created, > and they are not removed when we stop. > > Compared to the previous version of this patch: > - The always-inserted mode is actually configurable > - In always-inserted mode, breakpoints are removed > from target on detach/disconnect. > > OK? This patch is OK, if you will add the missing pieces: a NEWS entry and documentation for the new command, and a testcase that enables always-inserted and verifies that it isn't a brick. > +static void > +insert_breakpoint_locations (void); No newline before function name in prototypes. > +/* If 1, gdb will keep breakpoints inserted even as > + inferior is stopped, and immediately insert any new > + breakoints. > + If 0, gdb will insert breakpoints into inferior only > + when rusuming it, and will remove breakpoints > + upon stop. */ Typos: breakoints, rusuming. I've noticed your comments always wrap early, around column 60 instead of 72 or 79; is there any particular reason for that? It looks awkward when other comments in the same file wrap further over. > + /* Identify bp_location instances that are not > + longer present in the new list, and therefore should no longer present > + /* If this location is not longer present, and ditto > + inserted, look if there's maybe new location a new location > + at the same address. If so, mark that one > + inserted, and don't remove this one. > + > + This is needed so that we don't have a window > + where a breakpoint at certian location is not certain > + /* For the sake of should_insert_location. The > + call the check_duplicates will fix up this later. */ the call to > + if (loc->inserted && !found_object && !found_address) > { > - tmp = &((*tmp)->global_next); > + /* FIXME? Handle error? */ > + remove_breakpoint (loc, mark_uninserted); > } Can you take care of this FIXME? > +int breakpoints_always_inserted_mode () > +{ > + return always_inserted_mode; > +} (void) > + > > /* This help string is used for the break, hbreak, tbreak and thbreak commands. > It is defined as a macro to prevent duplication. > @@ -8341,6 +8393,19 @@ a warning will be emitted for such breakpoints."), > show_automatic_hardware_breakpoints, > &breakpoint_set_cmdlist, > &breakpoint_show_cmdlist); > + > + add_setshow_boolean_cmd ("always-inserted", class_support, > + &always_inserted_mode, _("\ > +Set mode for inserting breakpoints."), _("\ > +Show mode for inserting breakpoints."), _("\ > +When this mode is off (which is default), breakpoints are inserted in\n\ which is the default > +inferior when it is resumed, and removed when execution stops. When this\n\ > +mode is on, breakpoints are inserted immediately and removed only when\n\ > +the user deletes the breakpoint."), > +extern int breakpoints_always_inserted_mode (); (void) > @@ -1350,10 +1358,6 @@ handle_inferior_event (struct execution_control_state *ecs) > established. */ > if (stop_soon == NO_STOP_QUIETLY) > { > - /* Remove breakpoints, SOLIB_ADD might adjust > - breakpoint addresses via breakpoint_re_set. */ > - remove_breakpoints (); > - > /* Check for any newly added shared libraries if we're > supposed to be adding them automatically. Switch > terminal for any messages produced by > @@ -1393,9 +1397,6 @@ handle_inferior_event (struct execution_control_state *ecs) > > /* NOTE drow/2007-05-11: This might be a good place to check > for "catch load". */ > - > - /* Reinsert breakpoints and continue. */ > - insert_breakpoints (); > } > > /* If we are skipping through a shell, or through shared library This does the right thing even with breakpoints not always inserted, right? -- Daniel Jacobowitz CodeSourcery