From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18033 invoked by alias); 21 Apr 2011 15:27:41 -0000 Received: (qmail 18024 invoked by uid 22791); 21 Apr 2011 15:27:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Apr 2011 15:27:21 +0000 Received: (qmail 19367 invoked from network); 21 Apr 2011 15:27:21 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Apr 2011 15:27:21 -0000 From: Pedro Alves To: Tom Tromey Subject: Re: [PATCH] Remove same-pc breakpoint notification for internal BPs Date: Thu, 21 Apr 2011 15:27:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, Kevin Pouget References: <201104211559.40948.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104211627.20994.pedro@codesourcery.com> 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: 2011-04/txt/msg00397.txt.bz2 On Thursday 21 April 2011 16:05:30, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves writes: > > Pedro> I never understood why we need that function (as is implemented) though. > > IIRC I added it to pull common code out of a few spots, and at the same > time regularize it. I think different spots were using slightly > different checks. > > I don't object to the current patch. > > Pedro> What could be !user_settable_breakpoint whose b->number is > 0? > Pedro> IOW, why isn't that just : > [...] > > I don't know; I think the change to introduce the function just > commonized pre-existing code. Yeah, user_settable_p, but I'm thinking further back than that. user_settable_breakpoint was introduced here: but it was a refactor. I looked at the sources of a gdb of around that time, and internal breakpoints with negative numbers already existed then. I looked further back. Looking at gdb 4.6's (1992) sources, gdb already had breakpoint types (bp_until, etc.) by then, but there's no decrementing `internal_breakpoint_number' yet, and the code Cagney's patch is refactoring out appears to be there already, in a more primitive form. `internal_breakpoint_number' appears to have been added circa 1996 (from ChangeLog). breakpoint_1, gdb 4.2: /* We only print out user settable breakpoints unless the allflag is set. */ if (!allflag && b->type != bp_breakpoint && b->type != bp_watchpoint) continue; It looks like this grew as breakpoint types were added, but when `internal_breakpoint_number' was added, it was kept. -- Pedro Alves