FYI: minor simplification in add_psymbol_to_bcache

Daniel Jacobowitz drow@false.org
Tue Nov 3 20:21:00 GMT 2009


On Tue, Nov 03, 2009 at 01:10:24PM -0700, Tom Tromey wrote:
> This patch changes add_psymbol_to_bcache in two ways.
> 
> First, it removes the gratuitous use of a 'static' local variable.

It adds a memset... if you assume that this is a hot function, then it
was probably avoided on purpose.  On the other hand, the way it's
implemented is quite dodgy; there will be bogus padding if
sizeof (long) != sizeof (CORE_ADDR) and you alternate adding symbols
with VAL and COREADDR set.

> Second, it removes the copying of 'name'.  I think this copy is not
> needed because SYMBOL_SET_NAMES handles this case itself.

Yes, must predate SYMBOL_SET_NAMES>

I have no objection.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list