This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] delete BLOCK_SHOULD_SORT
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 18 Sep 2002 22:25:13 -0400
- Subject: Re: [RFA] delete BLOCK_SHOULD_SORT
- References: <ro1u1knrlkj.fsf@jackfruit.Stanford.EDU>
On Wed, Sep 18, 2002 at 03:15:40PM -0700, David Carlton wrote:
> I'd like to delete all occurences of BLOCK_SHOULD_SORT from GDB; it's
> really no longer necessary, and will get in the way of my dictionary
> work.
>
> The history, as I understand it, is that formerly symbols in blocks
> were always stored linearly; but, for blocks where the order didn't
> matter, the symbols were sorted to improve search time. Then blocks
> using hashtables were introduced; these are now used almost everywhere
> that sorted linear blocks had been previously used. In particular,
> blocks produced by buildsym.c, which is the vast majority of blocks,
> will never satisfy BLOCK_SHOULD_SORT.
...
> So, basically, making this change will get rid of some cruft, make an
> unnoticeable speed improvement to symbol manipulation stuff for normal
> usage, and when debugging ECOFF files, symbol table lookup will be a
> bit slower. (But it will still be correct: this is removing an
> optimization, but the unoptimized behavior will still work.) If
> anybody out there actually uses ECOFF and is bothered by this, clearly
> the best thing would be for that person to convert mdebugread.c to use
> the mechanisms in buildsym.c just like every other debugging format
> reader.
>
> 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.
For what it's worth, it all looks good (and worth doing!) to me.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer