/* Symbol table lookup for the GNU debugger, GDB.
- Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
returnval = lookup_symbol_aux (modified_name, block, namespace,
is_a_field_of_this, symtab);
if (needtofreename)
- free (modified_name2);
+ xfree (modified_name2);
return returnval;
}
{
/* This is a mangled variable, look it up by its
mangled name. */
- return lookup_symbol (SYMBOL_NAME (msymbol), block,
- namespace, is_a_field_of_this, symtab);
+ return lookup_symbol_aux (SYMBOL_NAME (msymbol), block,
+ namespace, is_a_field_of_this, symtab);
}
/* There are no debug symbols for this file, or we are looking
for an unmangled variable.
&& MSYMBOL_TYPE (msymbol) != mst_file_text
&& !STREQ (name, SYMBOL_NAME (msymbol)))
{
- return lookup_symbol (SYMBOL_NAME (msymbol), block,
- namespace, is_a_field_of_this, symtab);
+ return lookup_symbol_aux (SYMBOL_NAME (msymbol), block,
+ namespace, is_a_field_of_this, symtab);
}
}
}
{
center = bottom + (top - bottom) / 2;
if (!(center < top))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (!do_linear_search
&& (SYMBOL_LANGUAGE (*center) == language_java))
{
do_linear_search = 1;
}
- if (STRCMP (SYMBOL_SOURCE_NAME (*center), name) >= 0)
+ if (strcmp (SYMBOL_SOURCE_NAME (*center), name) >= 0)
{
top = center;
}
}
}
if (!(top == bottom))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so
we don't have to force a linear search on C++. Probably holds true
{
top = inc;
}
- else if (STRCMP (SYMBOL_SOURCE_NAME (sym), name) < 0)
+ else if (strcmp (SYMBOL_SOURCE_NAME (sym), name) < 0)
{
bot = inc;
}
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
- if (SYMBOL_MATCHES_NAME (sym, name))
- return sym;
+ if (SYMBOL_NAMESPACE (sym) == namespace &&
+ SYMBOL_MATCHES_NAME (sym, name))
+ {
+ return sym;
+ }
bot++;
}
}
for (p = symbols; p != NULL; p = next)
{
next = p->next;
- free (p);
+ xfree (p);
}
}
struct symbol_search *tail;
struct cleanup *old_chain = NULL;
- if (kind < LABEL_NAMESPACE)
+ if (kind < VARIABLES_NAMESPACE)
error ("must search on specific namespace");
ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
else
{
fputs_filtered (demangled_name, stream);
- free (demangled_name);
+ xfree (demangled_name);
}
#endif
}
{
if (STREQ (new, return_val[i]))
{
- free (new);
+ xfree (new);
return;
}
}
/* skip symbols that cannot match */
if (strcmp (sym_name, oload_name) != 0)
{
- free (sym_name);
+ xfree (sym_name);
return;
}
sym_return_val[sym_return_val_index++] = sym;
sym_return_val[sym_return_val_index] = NULL;
- free (sym_name);
+ xfree (sym_name);
}
/* Return a null-terminated list of pointers to function symbols that
}
}
- free (oload_name);
+ xfree (oload_name);
return (sym_return_val);
}