From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18635 invoked by alias); 13 Sep 2009 17:06:27 -0000 Received: (qmail 18627 invoked by uid 22791); 13 Sep 2009 17:06:27 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Sep 2009 17:06:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E91792BABDA; Sun, 13 Sep 2009 13:06:21 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fZF2gvmf19Ru; Sun, 13 Sep 2009 13:06:21 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id B0D8A2BAB1A; Sun, 13 Sep 2009 13:06:21 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6FAFBF589B; Sun, 13 Sep 2009 10:06:18 -0700 (PDT) Date: Sun, 13 Sep 2009 17:06:00 -0000 From: Joel Brobecker To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [RFA] move dwarf2_free_objfile to dwarf2_per_objfile_cleanup Message-ID: <20090913170618.GC8327@adacore.com> References: <20090904235009.5FA8D843B9@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090904235009.5FA8D843B9@localhost> User-Agent: Mutt/1.5.18 (2008-05-17) 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-09/txt/msg00385.txt.bz2 > 2009-09-04 Doug Evans > > * symfile.h (dwarf2_free_objfile): Delete. > * dwarf2read.c (dwarf2_build_psymtabs_hard): Pass dwarf2_per_objfile > to free_cached_comp_units. > (free_cached_comp_units): Remove reference to global > dwarf2_per_objfile, use passed parameter instead. > (dwarf2_free_objfile): Delete, contents moved to ... > (dwarf2_per_objfile_cleanup): ... here. > * coffread.c (coff_symfile_finish): Delete call to dwarf2_free_objfile. > * elfread.c (elf_symfile_finish): Delete call to dwarf2_free_objfile. Not really an expert in this area, but does it look like you are re-reading the per-objfile data a second time when converting from a psymtab to a symtab? On the plus side, I really find it makes the code clearer to understand - it's a bit hard to figure out the lifetime of this global... Was the memory every released before? (I see two calls to sym_finish, one when free_objfile is called, and one when reread_symbols is called - these two are not necessarily called after the symtab has been computed) -- Joel