aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-01-04 13:15:20 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-01-04 13:15:20 +0000
commit1a2da5eef019728312010d41acce8551de21c175 (patch)
treea117cab82f5d6a0bafcde983ae3f8a42d0a990e5 /gdb/linespec.c
parent71141310f5b64e62555792867496b1d580c582f0 (diff)
downloadgdb-1a2da5eef019728312010d41acce8551de21c175.zip
gdb-1a2da5eef019728312010d41acce8551de21c175.tar.gz
gdb-1a2da5eef019728312010d41acce8551de21c175.tar.bz2
linespec: keep function descriptors during minimal symbol search
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.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 3505af9..6276a3a 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2799,7 +2799,17 @@ add_minsym (struct minimal_symbol *minsym, void *d)
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),
+ &current_target);
+
+ if (addr == SYMBOL_VALUE_ADDRESS (minsym))
+ return;
+ }
}
mo.minsym = minsym;