This is the mail archive of the gdb@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]

The perils of strcmp_iw


minsyms.c:minsym_hash_iw has:
/* Compute a hash code based using the same criteria as `strcmp_iw'.  */

But actually it doesn't.  strcmp_iw has the property of "foo == foo(arg)";
minsym_hash_iw has the stronger property of stops-at-first-left-parenthesis.
Suppose that we have something like "foo::operator()", or the horrific
"int foo<&(bar())>()" [yes, that's a real mangled name.  No, I'm not
immediately sure why the return type is included.  I suspect this drives our
current code absolutely wild.]

This is mostly a disgusted note to myself to clean up the comments; the hash
function is weaker than the equality test (terminology?), so we're OK.  The
equality test has the potential for spurious matches but only if they have
unbalanced parens in them, so I'm not concerned right now.  I just happened
to notice this while working on something else.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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