From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7859 invoked by alias); 10 Nov 2011 17:57:57 -0000 Received: (qmail 7836 invoked by uid 22791); 10 Nov 2011 17:57:56 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate7.uk.ibm.com (HELO mtagate7.uk.ibm.com) (194.196.100.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Nov 2011 17:57:41 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pAAHvde1021411 for ; Thu, 10 Nov 2011 17:57:39 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAAHvdxd2576614 for ; Thu, 10 Nov 2011 17:57:39 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAAHvc0X000441 for ; Thu, 10 Nov 2011 10:57:39 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id pAAHvaCl032698; Thu, 10 Nov 2011 10:57:36 -0700 Message-Id: <201111101757.pAAHvaCl032698@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 10 Nov 2011 18:57:36 +0100 Subject: Re: RFC: don't set the pspace on ordinary breakpoints To: tromey@redhat.com (Tom Tromey) Date: Thu, 10 Nov 2011 17:57:00 -0000 From: "Ulrich Weigand" Cc: pedro@codesourcery.com (Pedro Alves), gdb-patches@sourceware.org In-Reply-To: from "Tom Tromey" at Nov 10, 2011 09:52:38 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2011-11/txt/msg00286.txt.bz2 Tom Tromey wrote: > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 8c98bef..ec45335 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -1568,6 +1568,9 @@ should_be_inserted (struct bp_location *bl) > if (!bl->enabled || bl->shlib_disabled || bl->duplicate) > return 0; > > + if (user_breakpoint_p (bl->owner) && bl->pspace->executing_startup) > + return 0; > + > /* This is set for example, when we're attached to the parent of a > vfork, and have detached from the child. The child is running > free, and we expect it to do an exec or exit, at which point the > @@ -5313,8 +5316,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch, > printf_filtered (" (thread %d)", b->thread); > printf_filtered ("%s%s ", > ((b->enable_state == bp_disabled > - || b->enable_state == bp_call_disabled > - || b->enable_state == bp_startup_disabled) > + || b->enable_state == bp_call_disabled) > ? " (disabled)" > : b->enable_state == bp_permanent > ? " (permanent)" > @@ -6933,48 +6935,48 @@ enable_watchpoints_after_interactive_call_stop (void) > void > disable_breakpoints_before_startup (void) > { > - struct breakpoint *b; > + struct bp_location *loc, **locp_tmp; > int found = 0; > > - ALL_BREAKPOINTS (b) > + current_program_space->executing_startup = 1; > + > + ALL_BP_LOCATIONS (loc, locp_tmp) > { > - if (b->pspace != current_program_space) > + if (loc->pspace != current_program_space) > continue; > > - if ((b->type == bp_breakpoint > - || b->type == bp_hardware_breakpoint) > - && breakpoint_enabled (b)) > + if ((loc->owner->type == bp_breakpoint > + || loc->owner->type == bp_hardware_breakpoint) Should this now use the same condition as above, i.e. user_breakpoint_p (b) ? > + && breakpoint_enabled (loc->owner)) > { > - b->enable_state = bp_startup_disabled; > found = 1; > + break; > } > } > > if (found) > update_global_location_list (0); Or maybe rather, since the sole remaining function of that loop is to sometimes skip the update_global_location_list, which doesn't appear to have any reason except performance tuning (which is really unnecessary here as this routine is called extremely rarely) -- why not just remove the whole loop and just call update_global_location_list unconditionally? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com