This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] Use custom hash function with bcache


On 08/16/2010 03:13 PM, Daniel Jacobowitz wrote:
On Mon, Aug 16, 2010 at 10:10:41AM -0400, sami wagiaalla wrote:
This patch enables the use of custom hash and comparison functions
when adding elements to a bcache. The patch also introduces hash and
comparison functions which take into consideration only the relevant
properties of the psymbol.

This patch makes me nervous because it's violating the invariants of the bcache. Any time you get a psymbol from the bcache, it is going to have other fields that were not hashed somewhat random. What are those ignored fields, and why do they not matter? How about lifetimes, are they as long-lived as the bcache?


I only took into consideration the values which are set by add_psymbol_to_bcache. The assumption is that these are the only values that will make a difference since they are the only values available when calculating the hash.


You compare name, value, language, domain, and class.  The mangled
name is ignored; this assumes that there is only ever one mangled name
per demangled name, with no documentation of why that's safe to
assume.

Hmm, the demangled name can be added if this is not a correct assumption. I just wanted to avoid the redundant check, and language_specific part of the symbol.


Section is ignored; if there are two definitions of a symbol
with the same name in different sections but the same value otherwise,
we'll never find out.  That could break overlays.


Section is set to 0 by add_psymbol_to_bcache



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