RFA/symtab: (Almost) always hash blocks when searching them

Daniel Jacobowitz drow@mvista.com
Sun Feb 9 22:37:00 GMT 2003


On Sun, Feb 09, 2003 at 05:03:21PM -0500, Daniel Jacobowitz wrote:
> I'm working on modifying the symbol lookup functions to return multiple
> symbols when there are multiple possible matches, and I didn't want to have
> to modify all three kinds of binary search in lookup_block_symbol.  First I
> tried fixing mdebugread.c to generate hashed blocks properly; it was too
> messy, and I couldn't build an mdebug toolchain to test with [mips-ecoff was
> my best guess, and it's been broken for months.  Part of it was my fault and
> then GCC started segfaulting after I fixed that].
> 
> So instead, I added a new function to hash a block retroactively.  Then, in
> lookup_block_symbol, where we would previously have done a binary search we
> instead hash the block and do a hash table search.  Amortized cost is
> somewhat lower, complexity cost is much lower.  I like it.
> 
> I also updated the comments; the bit about not matching demangled names was
> out of date.  Symbols are hashed by their demangled name, if any.
> 
> Is this patch OK?

Never mind for now.  I'm solving my problem in a different way, and I
didn't notice the constness issue with this patch before I posted it.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb-patches mailing list