From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1578 invoked by alias); 12 Feb 2008 05:35:10 -0000 Received: (qmail 1568 invoked by uid 22791); 12 Feb 2008 05:35:10 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Feb 2008 05:34:52 +0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.42.96.5]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id AAA22960; Tue, 12 Feb 2008 00:20:12 -0500 Received: from [192.168.20.209] (pptp_vpn-20-209 [192.168.20.209]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id AAA14040; Tue, 12 Feb 2008 00:34:49 -0500 Message-ID: <47B12FF9.8080106@qnx.com> Date: Tue, 12 Feb 2008 05:35:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sourceware.org Subject: Re: [patch] Do not add partial_symbol again and again to the list References: <20080211203809.GA29560@caradoc.them.org> <47B0B56F.4010607@qnx.com> <20080211210935.GA31767@caradoc.them.org> <47B0C0F4.4090302@qnx.com> <20080211214750.GA1953@caradoc.them.org> <47B0C7C6.9090605@qnx.com> <20080211223056.GA3833@caradoc.them.org> <47B0CF8A.6080306@qnx.com> <20080211225314.GA5832@caradoc.them.org> <47B0F16B.9090308@qnx.com> <20080212021156.GA15744@caradoc.them.org> In-Reply-To: <20080212021156.GA15744@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-02/txt/msg00197.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Feb 11, 2008 at 08:07:55PM -0500, Aleksandar Ristovski wrote: >> struct dwarf2_cu has a pointer to struct objfile, which (if I'm not >> mistaken) get's allocated per compilation unit. > > That's where your confusion is. An objfile is something like > "/lib/libc.so.6", a linked file. A compilation unit is something > like "init.o", a single "gcc -c" output. Ahhh.... Thank you. I did get confused with the name. However, I think the patch is still good. What happens with the patch is that for an objfile, we will add global type information only once, in the first partial symbol table where the symbol was encountered. I think this will be fine. Type info will not have address associated and all information we can get about it will be there. Finding the first matching partial symbol for a type symbol is as good as finding the second or N-th partial symbol for that type (and domain). On the other hand, for anything that is linked, i.e. has an address, the partial_symbol must be unique (linker should make sure of that: mangled name, etc...) and my patch will not affect adding such symbols.