When discarding data (minimal) symbols, we need to be careful to
not throw away the function descriptors. This makes a difference
on platforms where these descriptors are used and live in a data
section.
gdb/ChangeLog:
* linespec.c (add_minsym): Preserve function descriptors.
+2012-01-04 Joel Brobecker <brobecker@adacore.com>
+
+ * linespec.c (add_minsym): Preserve function descriptors.
+
2012-01-04 Ulrich Weigand <uweigand@de.ibm.com>
* breakpoint.c (all_locations_are_pending): Consider locations
case mst_abs:
case mst_file_data:
case mst_file_bss:
- return;
+ {
+ /* Make sure this minsym is not a function descriptor
+ before we decide to discard it. */
+ struct gdbarch *gdbarch = info->objfile->gdbarch;
+ CORE_ADDR addr = gdbarch_convert_from_func_ptr_addr
+ (gdbarch, SYMBOL_VALUE_ADDRESS (minsym),
+ ¤t_target);
+
+ if (addr == SYMBOL_VALUE_ADDRESS (minsym))
+ return;
+ }
}
mo.minsym = minsym;