This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] generate symbols associated to namespaces
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 5 Aug 2003 13:54:29 -0400
- Subject: Re: [rfa] generate symbols associated to namespaces
- References: <m3k7blg4dr.fsf@kealia.com> <20030622173547.GA22603@nevyn.them.org> <ro1brwntjhz.fsf@jackfruit.Stanford.EDU> <20030624185019.GA24662@nevyn.them.org> <yf28yrn1p8i.fsf@hawaii.kealia.com> <yf2k7b7yyg5.fsf@hawaii.kealia.com>
On Fri, Jun 27, 2003 at 02:58:50PM -0700, David Carlton wrote:
> On Fri, 27 Jun 2003 09:04:13 -0700, David Carlton <carlton@kealia.com> said:
>
> > I've looked at your code comments, and they all seem reasonable. I
> > hope I'll have a revised version of the patch today; job transition
> > issues will take up some of my time (I start full-time work at
> > Kealia today, so I have to figure out what they want me to do other
> > than hack GDB), but it's near the top of my priority list.
>
> Okay, here's the new version. Following Daniel's suggestion, it puts
> symbols associated to DW_TAG_namespace in the symtab where they are
> found, instead of in a special block, and creates one possible
> namespace block for each objfile. This fixes the problem Daniel found
> with the last version of my patch (which, incidentally, turns out also
> to show up under DWARF 2 with pr-1210.exp; the more tests the
> merrier).
>
> Tested with GCC 3.2, i686-pc-linux-gnu with both DWARF 2 and stabs+,
> and with a version of GCC 3.2.3 that generates DW_TAG_namespace DIEs.
> No new regressions (though the new tests in gdb.c++/namespace.exp fail
> under stabs+, as expected).
>
> How does this one look to y'all?
Sorry 'bout the delay. This looks good to me; Elena?
Minor comments:
> +/* Allocate everything necessary the possible namespace block
> + associated to OBJFILE. */
Grammar :)
> + /* Allocate empty GLOBAL_BLOCK and STATIC_BLOCK. */
> +
> + bl = allocate_block (&objfile->symbol_obstack);
> + BLOCK_DICT (bl) = dict_create_linear (&objfile->symbol_obstack,
> + NULL);
> + BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = bl;
> + bl = allocate_block (&objfile->symbol_obstack);
> + BLOCK_DICT (bl) = dict_create_linear (&objfile->symbol_obstack,
> + NULL);
> + BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = bl;
> +
> + /* Allocate the possible namespace block; we put it where the first
> + local block will live, though I don't think there's any need to
> + pretend that it's actually a local block (e.g. by setting
> + BLOCK_SUPERBLOCK appropriately). */
> +
> + bl = allocate_block (&objfile->symbol_obstack);
> + BLOCK_DICT (bl) = dict_create_hashed_expandable ();
> + BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK) = bl;
Is there any particular reason not to use the global block? If so
might want to comment what it is.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer