diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-01-04 13:15:20 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-01-04 13:15:20 +0000 |
commit | 1a2da5eef019728312010d41acce8551de21c175 (patch) | |
tree | a117cab82f5d6a0bafcde983ae3f8a42d0a990e5 /gdb/linespec.c | |
parent | 71141310f5b64e62555792867496b1d580c582f0 (diff) | |
download | gdb-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.c | 12 |
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), + ¤t_target); + + if (addr == SYMBOL_VALUE_ADDRESS (minsym)) + return; + } } mo.minsym = minsym; |