From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30034 invoked by alias); 20 Mar 2013 22:18:07 -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 29937 invoked by uid 89); 20 Mar 2013 22:17:56 -0000 X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 20 Mar 2013 22:17:53 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2KMHqRL012290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Mar 2013 18:17:52 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2KMHpdf001475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Mar 2013 18:17:52 -0400 Message-ID: <514A358F.3080403@redhat.com> Date: Thu, 21 Mar 2013 00:42:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org ml" Subject: Re: [RFA] Stop leaking extra_string References: <514A08A5.6020504@redhat.com> <514A0A9E.1090105@redhat.com> In-Reply-To: <514A0A9E.1090105@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-03/txt/msg00771.txt.bz2 On 03/20/2013 12:14 PM, Pedro Alves wrote: > When we get to this bit in addr_string_to_sals (called through > breakpoint_re_set_default): > > if (cond_string) > b->cond_string = cond_string; > b->thread = thread; > b->task = task; > if (extra_string) > b->extra_string = extra_string; > b->condition_not_parsed = 0; > > Is b->extra_string always NULL here, or could we be > leaking it here too? I don't think that is possible right now. When extra_string is set by find_condition_and_thread, init_breakpoint_sal (called from ops->create_breakpoints_sal) will error if extra_string isn't NULL (for non-dprintf breakpoints). So the only way to get extra_string != NULL in breakpoint_re_set is by setting a pending dprintf breakpoint, which doesn't even work because any pending breakpoint will automatically have extra_string set to NULL in create_breakpoint. But this is all largely academic for two reasons: 1) Adding an xfree there wouldn't hurt; 2) I'm going to submit a patch to do just that because I am changing it so that extra_string could be set. :-) I've committed my original patch. Thank you for taking a look at this. Keith