From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23603 invoked by alias); 12 Apr 2012 04:45:22 -0000 Received: (qmail 23588 invoked by uid 22791); 12 Apr 2012 04:45:19 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 04:45:07 +0000 Received: by vcbfk14 with SMTP id fk14so1371061vcb.0 for ; Wed, 11 Apr 2012 21:45:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=9i1X0vKJb2AcAdbYf/zbGBBYkvY9BHW79iqJieArLxw=; b=dHGAsyQUzluMpLxD5yifDOmIUEyZrqAuSPbKDiDOaq7ZKSwVMAbTPBD5pcSU/+n0sd i8N1QVZabVXNOwIbSy4U5oQfM2vNn5IbgErmx76fndoCN2W/dmLIqkJGDeXQsGCTuVPw 1O6SZro1g+8DGa3geBCTqv+hd3vrBh1pSPr9TJ3hWZF7WgWmykAJpql6VgMDYSQyGBu2 nAF0l0I7blYBdbwN1StG6467QntbU+/pgL3VRQo5fmP0/Dy16lKvHMnBNQv5p7BdnA2p D4qJF4EfTAbi/XuNuQxlxgPRYBk471lpxqOnvIWN/aJ8zn2KS8Y361HRNFObwufL/tSv e+yw== Received: by 10.220.202.4 with SMTP id fc4mr525813vcb.56.1334205906068; Wed, 11 Apr 2012 21:45:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.202.4 with SMTP id fc4mr525805vcb.56.1334205905898; Wed, 11 Apr 2012 21:45:05 -0700 (PDT) Received: by 10.220.7.74 with HTTP; Wed, 11 Apr 2012 21:45:05 -0700 (PDT) In-Reply-To: <1334149619-2738-1-git-send-email-yao@codesourcery.com> References: <1334149619-2738-1-git-send-email-yao@codesourcery.com> Date: Thu, 12 Apr 2012 05:16:00 -0000 Message-ID: Subject: Re: [PATCH] breakpoint always inserted in record target From: Doug Evans To: Yao Qi Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQmnEsA8F0T+1tr6+rDtg6De7a2eqZA9EP7eKomC2V4U+a9rEbiYFb0r5GVpv+bEuEWk7BXA9oNlRlXY8K3dO4DHuCxlKnGzxVjfWph8hoNjqGCxh0mEOPaHxagD2WDJ4mLC1ZbvRihzLP+DxRDuruNAdNKBnA== 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: 2012-04/txt/msg00275.txt.bz2 On Wed, Apr 11, 2012 at 6:06 AM, Yao Qi wrote: > 2012-04-11 =A0Yao Qi =A0 > > =A0 =A0 =A0 =A0* breakpoint.c (iterate_over_bp_locations): New. > =A0 =A0 =A0 =A0* breakpoint.h: Declare. > =A0 =A0 =A0 =A0* record.c (record_open): Call record_init_record_breakpoi= nts. > =A0 =A0 =A0 =A0(record_sync_record_breakpoints): New. > =A0 =A0 =A0 =A0(record_init_record_breakpoints): New. > --- > =A0gdb/breakpoint.c | =A0 13 +++++++++++++ > =A0gdb/breakpoint.h | =A0 =A02 ++ > =A0gdb/record.c =A0 =A0 | =A0 30 ++++++++++++++++++++++++++++++ > =A03 files changed, 45 insertions(+), 0 deletions(-) > > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index be536bc..c5109d6 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -2425,6 +2425,19 @@ insert_breakpoints (void) > =A0 =A0 insert_breakpoint_locations (); > =A0} > > +/* Invoke CALLBACK for each of bp_location. =A0*/ > + > +void > +iterate_over_bp_locations (void (*callback) (struct bp_location *)) > +{ > + =A0struct bp_location *loc, **loc_tmp; > + > + =A0ALL_BP_LOCATIONS (loc, loc_tmp) > + =A0 =A0{ > + =A0 =A0 =A0callback (loc); > + =A0 =A0} > +} Hi. Nit: Functions that take callbacks generally also take a void* to pass to the callback. Plus, can you write a testcase?