+Thu Jan 20 15:04:24 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * printcmd.c (print_address_symbolic): Unconditionally use msymbol
+ if we did not find a symbol.
+
Fri Jan 21 08:20:18 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
* infptrace.c (child_xfer_memory): Only use if CHILD_XFER_MEMORY
struct minimal_symbol *msymbol;
struct symbol *symbol;
struct symtab *symtab = 0;
- CORE_ADDR name_location;
+ CORE_ADDR name_location = 0;
char *name;
/* First try to find the address in the symbol table, then
in the minsyms. Take the closest one. */
- symbol = fast_symbolic_addr? 0:
- find_addr_symbol (addr, &symtab, &name_location);
+ if (fast_symbolic_addr)
+ {
+ /* This is defective in the sense that it only finds text symbols. */
+ symbol = find_pc_function (addr);
+ if (symbol)
+ name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (symbol));
+ }
+ else
+ find_addr_symbol (addr, &symtab, &name_location);
+
if (symbol)
{
if (do_demangle)
msymbol = lookup_minimal_symbol_by_pc (addr);
if (msymbol != NULL)
{
- if (SYMBOL_VALUE_ADDRESS (msymbol) > name_location)
+ if (SYMBOL_VALUE_ADDRESS (msymbol) > name_location || symbol == NULL)
{
/* The msymbol is closer to the address than the symbol;
use the msymbol instead. */
name = SYMBOL_LINKAGE_NAME (msymbol);
}
}
+ if (symbol == NULL && msymbol == NULL)
+ return;
/* If the nearest symbol is too far away, don't print anything symbolic. */