This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] delete BLOCK_SHOULD_SORT


It looks good to me.

However, before we commit this, I'd really like to know how much worse
it makes mdebug-based targets.  For example, if the test suite starts
timing out a lot after this patch is applied because symbol lookup is
so slow, then I think we need to buildsym-ify mdebugread first.
However backwards we may find them, people are still using mdebug, and
making the test suite unusable would make it impossible for a company
like Red Hat to give them a code drop when they need one.

You'll need to be testing your namespace work on at least one
mdebug-based target anyway, so this shouldn't be much of an additional
burden.

> I think the changes are pretty straightforward, though I'd appreciate
> it if somebody more conversant with ada-lang.c than I am could make
> sure I'm not missing anything with my change there.

I don't know ada-lang.c, but they look mechanically correct to me.

>        top = BLOCK_NSYMS (block);
>        bot = 0;
>        while (bot < top)
>  	{
>  	  sym = BLOCK_SYM (block, bot);
> +	  /* If there is more than one symbol with the right name and
> +	     namespace, we return the first one; I believe it is now
> +	     impossible for us to encounter two symbols with the same
> +	     name and namespace here, because blocks containing
> +	     argument symbols are no longer sorted.  The exception is
> +	     for C++, where multiple functions (cloned constructors /
> +	     destructors, in particular) can have the same demangled
> +	     name.  So if we have a particular mangled name to match,
> +	     try to do so.  */

This comment still refers to sorted blocks.  And the rationale for
believing that it won't encounter two symbols with the right name and
namespace doesn't apply any more: this comment isn't describing code
that deals only with sorted blocks any more.  This is the code which
can encounter duplicates.

(It's odd to talk about "namespaces" (by which the comment means
symtab.h's namespace_enum) and C++ in the same paragraph.  It might be
nice to clarify that while you're at it.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]