From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27476 invoked by alias); 26 Jun 2009 16:40:05 -0000 Received: (qmail 27397 invoked by uid 22791); 26 Jun 2009 16:40:01 -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, 26 Jun 2009 16:39:36 +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 n5QGdXpK022888; Fri, 26 Jun 2009 12:39:33 -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 n5QGdWDL004360; Fri, 26 Jun 2009 12:39:32 -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 n5QGdUQZ007044; Fri, 26 Jun 2009 12:39:31 -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 n5QGdTNm014245; Fri, 26 Jun 2009 18:39:29 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n5QGdRlw014244; Fri, 26 Jun 2009 18:39:27 +0200 Date: Fri, 26 Jun 2009 16:40:00 -0000 From: Jan Kratochvil To: Ulrich Weigand Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [patch] [3/5] Types reference counting [make_function_type-objfile] Message-ID: <20090626163927.GA14063@host0.dyn.jankratochvil.net> References: <20090501144440.GA3213@host0.dyn.jankratochvil.net> <200906261323.n5QDN0Xi000973@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906261323.n5QDN0Xi000973@d12av02.megacenter.de.ibm.com> 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-06/txt/msg00734.txt.bz2 On Fri, 26 Jun 2009 15:23:00 +0200, Ulrich Weigand wrote: > - I think the symbol readers should always return per-objfile types. This > just makes everything simpler, in particular allocation of derived types > (as you notice). I think it would also good to be able to guarantee that > TYPE_OBJFILE of every symbol type is non-NULL ... This IMO means "any two types somehow interconnected (by TYPE_TARGET_TYPE, TYPE_INDEX_TYPE etc.) should have the same TYPE_OBJFILE". > - The Java generated types should *not* go onto the "fake" dynamics objfile > in the first place. That objfile is somewhat bogus in that it isn't > associated with an architecture (thus breaking my per-type architecture > effort), and it also don't help with type lifetime issues as the fake > objfile never goes away. I think those types should be allocated with > a NULL objfile (in the future are per-gdbarch types) instead. I see now dynamics_objfile should be replaced by NULL TYPE_OBJFILE and being a discardable type to be processed by the types garbage collector (which is still not checked-in). > Also, I think the implementation is broken in the "type smashing" case: > if there is an incoming type allocated in objfile A, but the argument to > make_function_type specifies objfile B, I do not think it can happen. So far always type A referencing -> type B either had the same TYPE_OBJFILE or TYPE_OBJFILE(B) was NULL. Using such assertion-checks without facing problems. As there cannot be a DWARF reference across objfiles (there can be one just across CUs) cross-file type references use TYPE_IS_OPAQUE and they get resolved each time on dereferencing such reference by calling check_typedef. > Therefore, I'd prefer to fix the two problems mentioned above, and then > revert your patch. If the current rule: # So far always type A referencing -> type B had either the same TYPE_OBJFILE # or TYPE_OBJFILE(B) was NULL. will be changed to: # Type A referencing -> type B had the same TYPE_OBJFILE. I only welcome it and sure I agree with reverting my patch afterwards. Thanks, Jan