From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26198 invoked by alias); 28 Feb 2010 15:38:23 -0000 Received: (qmail 26183 invoked by uid 22791); 28 Feb 2010 15:38:21 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-pz0-f187.google.com (HELO mail-pz0-f187.google.com) (209.85.222.187) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 28 Feb 2010 15:38:18 +0000 Received: by pzk17 with SMTP id 17so1253296pzk.31 for ; Sun, 28 Feb 2010 07:38:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.74.15 with SMTP id w15mr1889630wfa.117.1267371496368; Sun, 28 Feb 2010 07:38:16 -0800 (PST) In-Reply-To: <20100226125301.GB6773@host0.dyn.jankratochvil.net> References: <20100226125301.GB6773@host0.dyn.jankratochvil.net> From: Hui Zhu Date: Sun, 28 Feb 2010 15:38:00 -0000 Message-ID: Subject: Re: [RFA] patch for [Bug gdb/11253] To: Jan Kratochvil Cc: gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-02/txt/msg00678.txt.bz2 Hi Jan, I think your patch is more better. Thanks. :) Best regards, Hui On Fri, Feb 26, 2010 at 20:53, Jan Kratochvil w= rote: > On Fri, 26 Feb 2010 04:25:58 +0100, Hui Zhu wrote: >> This patch is for bug 11253 http://sourceware.org/bugzilla/show_bug.cgi?= id=3D11253 > [..] >> --- a/target.c >> +++ b/target.c >> @@ -2836,6 +2836,7 @@ init_dummy_target (void) >> =A0 =A0dummy_target.to_has_stack =3D (int (*) (struct target_ops *)) ret= urn_zero; >> =A0 =A0dummy_target.to_has_registers =3D (int (*) (struct target_ops *))= return_zero; >> =A0 =A0dummy_target.to_has_execution =3D (int (*) (struct target_ops *))= return_zero; >> + =A0dummy_target.to_stopped_by_watchpoint =3D return_zero; >> =A0 =A0dummy_target.to_magic =3D OPS_MAGIC; >> =A0} > > while there is already: > > update_current_target (void) > ... > =A0 =A0 =A0INHERIT (to_stopped_by_watchpoint, t); > + > =A0de_fault (to_stopped_by_watchpoint, > =A0 =A0 =A0 =A0 =A0 =A0(int (*) (void)) > =A0 =A0 =A0 =A0 =A0 =A0return_zero); > > and I wanted to propose the attached patch I expect it is because INHERIT= s are > deprecated now and current_target.beneath traversal is preferred nowadays. > > Just posted when I wrote it, IMo the patch of Hui's is the right one inst= ead. > > No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. > > > Thanks, > Jan > > > 2010-02-26 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0* record.c (record_open): Initialize tmp_to_insert_breakpo= int, > =A0 =A0 =A0 =A0tmp_to_remove_breakpoint, tmp_to_stopped_by_watchpoint and > =A0 =A0 =A0 =A0tmp_to_stopped_data_address directly from current_target. = =A0Remove their > =A0 =A0 =A0 =A0initialization during current_target.beneath chain travers= al. > > --- a/gdb/record.c > +++ b/gdb/record.c > @@ -895,8 +895,10 @@ record_open (char *name, int from_tty) > =A0 tmp_to_store_registers =3D NULL; > =A0 tmp_to_xfer_partial_ops =3D NULL; > =A0 tmp_to_xfer_partial =3D NULL; > - =A0tmp_to_insert_breakpoint =3D NULL; > - =A0tmp_to_remove_breakpoint =3D NULL; > + =A0tmp_to_insert_breakpoint =3D current_target.to_insert_breakpoint; > + =A0tmp_to_remove_breakpoint =3D current_target.to_remove_breakpoint; > + =A0tmp_to_stopped_by_watchpoint =3D current_target.to_stopped_by_watchp= oint; > + =A0tmp_to_stopped_data_address =3D current_target.to_stopped_data_addre= ss; > > =A0 /* Set the beneath function pointers. =A0*/ > =A0 for (t =3D current_target.beneath; t !=3D NULL; t =3D t->beneath) > @@ -921,14 +923,6 @@ record_open (char *name, int from_tty) > =A0 =A0 =A0 =A0 =A0tmp_to_xfer_partial =3D t->to_xfer_partial; > =A0 =A0 =A0 =A0 =A0tmp_to_xfer_partial_ops =3D t; > =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0if (!tmp_to_insert_breakpoint) > - =A0 =A0 =A0 tmp_to_insert_breakpoint =3D t->to_insert_breakpoint; > - =A0 =A0 =A0if (!tmp_to_remove_breakpoint) > - =A0 =A0 =A0 tmp_to_remove_breakpoint =3D t->to_remove_breakpoint; > - =A0 =A0 =A0if (!tmp_to_stopped_by_watchpoint) > - =A0 =A0 =A0 tmp_to_stopped_by_watchpoint =3D t->to_stopped_by_watchpoin= t; > - =A0 =A0 =A0if (!tmp_to_stopped_data_address) > - =A0 =A0 =A0 tmp_to_stopped_data_address =3D t->to_stopped_data_address; > =A0 =A0 } > =A0 if (!tmp_to_xfer_partial) > =A0 =A0 error (_("Could not find 'to_xfer_partial' method on the target s= tack.")); >