From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9502 invoked by alias); 1 May 2009 14:44:56 -0000 Received: (qmail 9476 invoked by uid 22791); 1 May 2009 14:44:54 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 May 2009 14:44:48 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n41EiloF018896 for ; Fri, 1 May 2009 10:44:47 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n41EikAB006089; Fri, 1 May 2009 10:44:46 -0400 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n41EihZ2009886; Fri, 1 May 2009 10:44:45 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n41EifRA005904; Fri, 1 May 2009 16:44:42 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n41Eie9N005898; Fri, 1 May 2009 16:44:40 +0200 Date: Fri, 01 May 2009 14:44:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [patch] [3/5] Types reference counting [make_function_type-objfile] Message-ID: <20090501144440.GA3213@host0.dyn.jankratochvil.net> References: <20090411102152.GD32624@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) 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: 2009-05/txt/msg00021.txt.bz2 On Thu, 16 Apr 2009 23:43:11 +0200, Tom Tromey wrote: > >>>>> "Jan" == Jan Kratochvil writes: > > Jan> make_function_type was sometimes being called with permanent > Jan> target type which would now also create a permanent function type > Jan> while it should be objfile-associated function type instead. > > The only one is in jv-lang.c, right? While jv-lang.c is also the case I originally found read_subroutine_type for function returning void - where such DW_TAG_subprogram has no DW_AT_type (return type) - and thus `builtin_type (gdbarch)->builtin_void' gets passed as TYPE to make_function_type originally deriving the OBJFILE for its returned function type from OBJFILE of that TYPE (internal in the void case). > I'd like to understand why function types are always permanent, though. This patch fixes only the real-OBJFILE vs. NULL-OBJFILE part which fixes the leak even without the types reference counting / garbage collecting patch. Whether NULL OBJFILE means permanent or discardable type I consider out of its scope. You still can make it discardable by `type_init_group (function_type)'. > This patch is ok. Checked it in in its original form: http://sourceware.org/ml/gdb-cvs/2009-05/msg00008.html Thanks, Jan