From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16341 invoked by alias); 21 Jan 2004 18:50:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16175 invoked from network); 21 Jan 2004 18:50:06 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 21 Jan 2004 18:50:06 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AjNQS-0007BZ-4q; Wed, 21 Jan 2004 13:50:04 -0500 Date: Wed, 21 Jan 2004 18:50:00 -0000 From: Daniel Jacobowitz To: David Carlton Cc: Paul Hilfinger , gdb-patches@sources.redhat.com Subject: Re: [RFC] Proposed changes in symbol-handling for Ada Message-ID: <20040121185004.GA23938@nevyn.them.org> Mail-Followup-To: David Carlton , Paul Hilfinger , gdb-patches@sources.redhat.com References: <200311082255.hA8MtJK08216@otisco.McKusick.COM> <20040120101613.F2871F2945@nile.gnat.com> <20040121112215.AE278F2810@nile.gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2004-01/txt/msg00590.txt.bz2 On Wed, Jan 21, 2004 at 08:49:36AM -0800, David Carlton wrote: > On Wed, 21 Jan 2004 06:22:15 -0500 (EST), Paul Hilfinger said: > > >> 3) Have Ada symbols save the demangled names of symbols after being > >> forced to demangle them. This could cause a memory increase if you > >> for some reason have to demangle lots of names. > > > That sounds entirely reasonable. > > >> (Hmm: where would you allocate the cached name from? You can't get at > >> the appropriate obstack from the symbol, can you? > > > Actually, the only true problem here is that the obvious way of > > answering this question---adding to the language-specific union a > > new entry containing an obstack* / char* union plus a > > flag---increases the size of a symbol (logically it doesn't have to, > > but C layout and alignment rules apparently add some padding). To > > avoid increasing its size, there is the aesthetically distateful > > option of adding a flag byte AFTER the language-specific field; or > > perhaps we could call it a union tag. Harumph. > > Harumph indeed. I know - we can grab one of the bits of the > obstack*/char* as a tag bit! (Just joking, folks, just joking.) Is > there any way to go from a bfd_section to an objfile? (After all, > presumably the obstack that we'd use is the relevant objfile's > symbol_obstack.) If that's not possible, we could store an objfile * > in the language-specific union in the Ada case (instead of a char *) > and then always retrieve the demangled names from the objfile's > demangled names hashtable, instead of caching it in the symbol. > (Inserting the names there first if they're not there already, of > course.) That should work. Well, you can go from a bfd_section to a bfd, and search objfiles. That's a little ugly though. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer