From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2828 invoked by alias); 11 Sep 2003 23:33:38 -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 2821 invoked from network); 11 Sep 2003 23:33:38 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 11 Sep 2003 23:33:38 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h8BNXbl17393 for ; Thu, 11 Sep 2003 19:33:37 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h8BNXae19015 for ; Thu, 11 Sep 2003 19:33:36 -0400 Received: from localhost.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h8BNXZba001951; Thu, 11 Sep 2003 19:33:36 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 6BF3D2CA3B; Thu, 11 Sep 2003 19:42:30 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16225.2149.530139.489355@localhost.redhat.com> Date: Thu, 11 Sep 2003 23:33:00 -0000 To: David Carlton Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [rfa] use allocate_block more In-Reply-To: References: <20030622173547.GA22603@nevyn.them.org> <20030624185019.GA24662@nevyn.them.org> <16222.12105.616302.481564@localhost.redhat.com> X-SW-Source: 2003-09/txt/msg00254.txt.bz2 David Carlton writes: > On Tue, 9 Sep 2003 15:51:37 -0400, Elena Zannoni said: > > > I think it would make sense, in a next pass, to have all the creation > > of blocks go through the new function. > > Well, I was planning to do that; here's what I came up with instead. > The problem is that mdebugread.c currently doesn't allocate blocks on > an obstack at all! That should presumably be fixed ("rm mdebugread.c" > would be my preferred method), but I didn't feel like doing that > right now; I'd rather leave it up to somebody with access to a machine > using mdebugread. > > Tested on i686-pc-linux-gnu, GCC 3.2, DWARF 2; no new regressions. OK > to commit? Yep. elena > > David Carlton > carlton@kealia.com > > 2003-09-11 David Carlton > > * buildsym.c (finish_block): Use allocate_block to allocate the > block. > * mdebugread.c (new_block): Add FIXME. > > Index: buildsym.c > =================================================================== > RCS file: /cvs/src/src/gdb/buildsym.c,v > retrieving revision 1.33 > diff -u -p -r1.33 buildsym.c > --- buildsym.c 11 Jun 2003 23:29:46 -0000 1.33 > +++ buildsym.c 11 Sep 2003 22:58:08 -0000 > @@ -231,19 +231,15 @@ finish_block (struct symbol *symbol, str > register struct pending_block *pblock; > struct pending_block *opblock; > > - /* Initialize the block's dictionary. */ > + block = allocate_block (&objfile->symbol_obstack); > > if (symbol) > { > - block = (struct block *) > - obstack_alloc (&objfile->symbol_obstack, sizeof (struct block)); > BLOCK_DICT (block) = dict_create_linear (&objfile->symbol_obstack, > *listhead); > } > else > { > - block = (struct block *) > - obstack_alloc (&objfile->symbol_obstack, sizeof (struct block)); > BLOCK_DICT (block) = dict_create_hashed (&objfile->symbol_obstack, > *listhead); > } > Index: mdebugread.c > =================================================================== > RCS file: /cvs/src/src/gdb/mdebugread.c,v > retrieving revision 1.47 > diff -u -p -r1.47 mdebugread.c > --- mdebugread.c 11 Jun 2003 23:29:47 -0000 1.47 > +++ mdebugread.c 11 Sep 2003 22:58:14 -0000 > @@ -4696,6 +4696,9 @@ new_bvect (int nblocks) > static struct block * > new_block (enum block_type type) > { > + /* FIXME: carlton/2003-09-11: This should use allocate_block to > + allocate the block. Which, in turn, suggests that the block > + should be allocated on an obstack. */ > struct block *retval = xzalloc (sizeof (struct block)); > > if (type == FUNCTION_BLOCK)