*symtab = NULL;
return 0;
}
-
+
/* Look, in partial_symtab PST, for symbol NAME. Check the global
symbols if GLOBAL, the static symbols if not */
int global;
namespace_enum namespace;
{
+ struct partial_symbol *temp;
struct partial_symbol **start, **psym;
struct partial_symbol **top, **bottom, **center;
int length = (global ? pst->n_global_syms : pst->n_static_syms);
int do_linear_search = 1;
-
+
if (length == 0)
{
return (NULL);
}
-
start = (global ?
pst->objfile->global_psymbols.list + pst->globals_offset :
pst->objfile->static_psymbols.list + pst->statics_offset);
-
+
if (global) /* This means we can use a binary search. */
{
do_linear_search = 0;
if (!(center < top))
abort ();
if (!do_linear_search
- && (SYMBOL_LANGUAGE (*center) == language_cplus
- || SYMBOL_LANGUAGE (*center) == language_java
- ))
+ && (SYMBOL_LANGUAGE (*center) == language_java))
{
do_linear_search = 1;
}
}
if (!(top == bottom))
abort ();
- while (STREQ (SYMBOL_NAME (*top), name))
+
+ /* 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
+ for JAVA as well, no way to check.*/
+ while (SYMBOL_MATCHES_NAME (*top,name))
{
if (SYMBOL_NAMESPACE (*top) == namespace)
{
- return (*top);
+ return (*top);
}
top++;
}
we should also do a linear search. */
if (do_linear_search)
- {
+ {
for (psym = start; psym < start + length; psym++)
{
if (namespace == SYMBOL_NAMESPACE (*psym))
symtab_symbol_info (regexp, FUNCTIONS_NAMESPACE, from_tty);
}
+
static void
types_info (regexp, from_tty)
char *regexp;
add_info ("functions", functions_info,
"All function names, or those matching REGEXP.");
+
/* FIXME: This command has at least the following problems:
1. It prints builtin types (in a very strange and confusing fashion).
2. It doesn't print right, e.g. with