From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11747 invoked by alias); 17 Apr 2008 17:48:35 -0000 Received: (qmail 11739 invoked by uid 22791); 17 Apr 2008 17:48:34 -0000 X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 17 Apr 2008 17:48:14 +0000 Received: from eusrcmw751.eamcs.ericsson.se (eusrcmw751.exu.ericsson.se [138.85.77.51]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id m3HHlflK025028; Thu, 17 Apr 2008 12:47:51 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw751.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Thu, 17 Apr 2008 12:47:45 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [Patch] Watchpoint condition fix Date: Thu, 17 Apr 2008 18:48:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04E1BCE9@ecamlmw720.eamcs.ericsson.se> References: <6D19CA8D71C89C43A057926FE0D4ADAA04E1BCD0@ecamlmw720.eamcs.ericsson.se> <20080416213350.GC3626@adacore.com> From: "Marc Khouzam" To: "Joel Brobecker" Cc: 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: 2008-04/txt/msg00357.txt.bz2 > This part of the change is OK, but I would like to see a comment Done > Also, you can remove the block of code that checks b->loc->cond > and frees when non-NULL, since we've just re-created the bplocs > earlier and we know that their cond field is NULL.=20 Done > As a result, > the temporary variable "s" shouldn't be necessary either. I'm not sure about this one. s is pointing to b->cond_string and not b->loc->cond. Is it really unecessary? Here is the updated patch (having kept the temp var s) Marc 2008-04-17 Marc Khouzam * breakpoint.c (update_watchpoint): Always reparse condition. Index: gdb/breakpoint.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.308 diff -u -r1.308 breakpoint.c --- gdb/breakpoint.c 15 Apr 2008 14:32:12 -0000 1.308 +++ gdb/breakpoint.c 17 Apr 2008 17:40:13 -0000 @@ -994,14 +994,14 @@ value_free (v); } =20 - if (reparse && b->cond_string !=3D NULL) + /* We just regenerated the list of breakpoint locations. + * The new location does not have its condition field set to anything + * and therefore, we must always reparse the cond_string, independen= tly + * of the value of the reparse flag. + */ + if (b->cond_string !=3D NULL) { char *s =3D b->cond_string; - if (b->loc->cond) - { - xfree (b->loc->cond); - b->loc->cond =3D NULL; - } b->loc->cond =3D parse_exp_1 (&s, b->exp_valid_block, 0); } }