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 14:08:39 -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> <20030805175429.GA29704@nevyn.them.org> <yf2vftcvv17.fsf@hawaii.kealia.com>
On Tue, Aug 05, 2003 at 11:06:28AM -0700, David Carlton wrote:
> On Tue, 5 Aug 2003 13:54:29 -0400, Daniel Jacobowitz <drow@mvista.com> said:
> > On Fri, Jun 27, 2003 at 02:58:50PM -0700, David Carlton wrote:
>
> >> + /* 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.
>
> Yes: we never want these symbols to be found by a normal search of all
> symtabs' global blocks, because we don't trust these symbols. We only
> want them found as a last resort, once we've looked every place that
> symbols associated to classes should live. So that's why I stash them
> in a local block. I'll add a comment to that effect.
OK. I would have thought that the fake symtab would never have been
searched normally, though - I guess it gets chained into
objfile->symtabs?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer