From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15591 invoked by alias); 31 Oct 2003 15:51:05 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 15523 invoked from network); 31 Oct 2003 15:51:03 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 31 Oct 2003 15:51:03 -0000 Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian)) id 1AFbYE-0000Iq-SF; Fri, 31 Oct 2003 10:51:02 -0500 Date: Fri, 31 Oct 2003 15:51:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: A gdb+bfd string pool? Message-ID: <20031031155102.GA1102@nevyn.them.org> Mail-Followup-To: Andrew Cagney , binutils@sources.redhat.com, gdb@sources.redhat.com References: <3FA27C9B.1000702@redhat.com> <20031031151927.GA32700@nevyn.them.org> <3FA283A7.7080706@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FA283A7.7080706@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-10/txt/msg00348.txt.bz2 On Fri, Oct 31, 2003 at 10:45:43AM -0500, Andrew Cagney wrote: > >On Fri, Oct 31, 2003 at 10:15:39AM -0500, Andrew Cagney wrote: > > > >>Hello, > >> > >>GDB, to contain its run-time size is, uses gdb/bcaches where ... > >>/* A bcache is a data structure for factoring out duplication in > >> read-only structures. You give the bcache some string of bytes S. > >> If the bcache already contains a copy of S, it hands you back a > >> pointer to its copy. Otherwise, it makes a fresh copy of S, and > >> hands you back a pointer to that. In either case, you can throw > >> away your copy of S, and use the bcache's. > >>One notable feature of this mechanism is that it lets you eliminate > >>string equality comparisons - equal bcache values implies equal strings. > >> > >>Now, if I'm reading the BFD elf reader correctly, elf-strtab implements > >>a similar mechanism (But I think it is currently only used by the > >>linker?). > >> > >>Should/could BFD export a string pool that GDB could use and then use > >>that for any slurped symbol names? > > > > > >Well, if so, it should go in libiberty - and in fact, is the hash table > >in libiberty in any way unsuited to replace bcache? > > The interface or the implementation? The bcache interface is focused > and simple (something that can't be said for that hash table). The > hashtab could certainly be used in the implementation (as elf-strtab did). So does gdb/symtab.c. > Anyway, back to the question. Does a [global] common pool make sense > for BFD? Oh, you meant an _instance_, not a data structure. Sorry. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer