/* GDB routines for manipulating the minimal symbol tables.
- Copyright (C) 1992-2014 Free Software Foundation, Inc.
+ Copyright (C) 1992-2015 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
and the second over the demangled hash table. */
int pass;
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (%s, %s, %s)\n",
+ name, sfile != NULL ? sfile : "NULL",
+ objfile_debug_name (objfile));
+ }
+
for (pass = 1; pass <= 2 && found_symbol.minsym == NULL; pass++)
{
/* Select hash list according to pass. */
/* External symbols are best. */
if (found_symbol.minsym != NULL)
- return found_symbol;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (...) = %s"
+ " (external)\n",
+ host_address_to_string (found_symbol.minsym));
+ }
+ return found_symbol;
+ }
/* File-local symbols are next best. */
if (found_file_symbol.minsym != NULL)
- return found_file_symbol;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (...) = %s"
+ " (file-local)\n",
+ host_address_to_string
+ (found_file_symbol.minsym));
+ }
+ return found_file_symbol;
+ }
/* Symbols for shared library trampolines are next best. */
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (...) = %s%s\n",
+ trampoline_symbol.minsym != NULL
+ ? host_address_to_string (trampoline_symbol.minsym)
+ : "NULL",
+ trampoline_symbol.minsym != NULL
+ ? " (trampoline)" : "");
+ }
return trampoline_symbol;
}