From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44225 invoked by alias); 11 Mar 2015 11:22: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 44199 invoked by uid 89); 11 Mar 2015 11:22:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 11 Mar 2015 11:22:57 +0000 Received: by padet14 with SMTP id et14so10631954pad.11 for ; Wed, 11 Mar 2015 04:22:56 -0700 (PDT) X-Received: by 10.70.124.138 with SMTP id mi10mr16147985pdb.39.1426072975932; Wed, 11 Mar 2015 04:22:55 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id fl4sm5708996pab.8.2015.03.11.04.22.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Mar 2015 04:22:55 -0700 (PDT) From: Yao Qi To: Sergio Durigan Junior Cc: GDB Patches Subject: Re: [PATCH 1/2] Implement breakpoint_find_if References: <1426030105-15485-1-git-send-email-sergiodj@redhat.com> <1426030105-15485-2-git-send-email-sergiodj@redhat.com> Date: Wed, 11 Mar 2015 11:22:00 -0000 In-Reply-To: <1426030105-15485-2-git-send-email-sergiodj@redhat.com> (Sergio Durigan Junior's message of "Tue, 10 Mar 2015 19:28:24 -0400") Message-ID: <86mw3jhj78.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00277.txt.bz2 Sergio Durigan Junior writes: > My first thought was to share the ALL_BREAKPOINTS* macros on > gdb/breakpoint.h, but they use a global variable local to > gdb/breakpoint.c, and I did not want to share that variable. So, in > order to keep the minimal separation, I decided to implement this > way of iterating through the existing 'struct breakpoint *'. Yeah, I agree that we should keep these variables private. > > This function was based on BFD's bfd_sections_find_if. If the > user-provided function returns 0, the iteration proceeds. Otherwise, > the iteration stops and the function returns the 'struct breakpoint *' > that is being processed. This means that the return value of this > function can be either NULL or a pointer to a 'struct breakpoint'. This is fine by me. breakpoint_find_if can be more widely used so that some other code in breakpoint.c can be moved out. --=20 Yao (=E9=BD=90=E5=B0=A7)