From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23180 invoked by alias); 5 Dec 2003 00:47:02 -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 23170 invoked from network); 5 Dec 2003 00:47:01 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 5 Dec 2003 00:47:01 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 2CE6247D61; Thu, 4 Dec 2003 16:47:03 -0800 (PST) Date: Fri, 05 Dec 2003 00:47:00 -0000 From: Joel Brobecker To: Elena Zannoni Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] stabs: remember types that cross reference another type Message-ID: <20031205004703.GK1652@gnat.com> References: <20031031200851.GD1236@gnat.com> <20031103225952.GA2412@gnat.com> <16334.50206.868506.409948@localhost.redhat.com> <20031205002258.GJ1652@gnat.com> <16335.53518.757219.89681@localhost.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline In-Reply-To: <16335.53518.757219.89681@localhost.redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2003-12/txt/msg00163.txt.bz2 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 261 > yep Great! For the record, here is the patch I ended up committing. 2003-12-04 J. Brobecker * stabsread.c (read_type): Save a reference to types that are defined as cross references to other types. Thanks, -- Joel --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="stabsread.c.diff" Content-length: 1106 Index: stabsread.c =================================================================== RCS file: /cvs/src/src/gdb/stabsread.c,v retrieving revision 1.68 diff -u -p -r1.68 stabsread.c --- stabsread.c 15 Nov 2003 21:49:30 -0000 1.68 +++ stabsread.c 5 Dec 2003 00:31:35 -0000 @@ -1564,11 +1564,9 @@ again: *pp = from + 1; } - /* Now check to see whether the type has already been - declared. This was written for arrays of cross-referenced - types before we had TYPE_CODE_TARGET_STUBBED, so I'm pretty - sure it is not necessary anymore. But it might be a good - idea, to save a little memory. */ + /* If this type has already been declared, then reuse the same + type, rather than allocating a new one. This saves some + memory. */ for (ppt = file_symbols; ppt; ppt = ppt->next) for (i = 0; i < ppt->nsyms; i++) @@ -1582,6 +1580,8 @@ again: { obstack_free (&objfile->type_obstack, type_name); type = SYMBOL_TYPE (sym); + if (typenums[0] != -1) + *dbx_lookup_type (typenums) = type; return type; } } --CE+1k2dSO48ffgeK--