summaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-05-03 00:37:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-05-03 00:37:35 +0000
commit9d52de1442728faf6277abef2d00f4dd7db78922 (patch)
tree6867392c182a8760e1a1776497e7e1ad3e285161 /gdb/minsyms.c
parent0c2b91649110ce8d8ccda4be09e942314aa2ed34 (diff)
downloadgdb-9d52de1442728faf6277abef2d00f4dd7db78922.tar.gz
* linespec.c: Include "target.h".
(minsym_found): Handle minimal symbols pointing to function descriptors. Use find_function_start_pc. * minsyms.c (msymbol_objfile): New function. * parse.c (write_exp_msymbol): Handle minimal symbols pointing to function descriptors. * symtab.c (fixup_section): Only use minimal symbol at the same address to determine section of a symbol. (find_function_start_pc): New function. (find_function_start_sal): Use it. * symtab.h (msymbol_objfile): Add prototype. (find_function_start_pc): Likewise. * value.c: Include "objfiles.h". (value_fn_field): Handle minimal symbols pointing to function descriptors. * Makefile.in (linespec.o): Update dependencies. (value.o): Likewise.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 1d0ae6c7f91..8dceb0d7f5e 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -132,6 +132,26 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
}
+/* Return OBJFILE where minimal symbol SYM is defined. */
+struct objfile *
+msymbol_objfile (struct minimal_symbol *sym)
+{
+ struct objfile *objf;
+ struct minimal_symbol *tsym;
+
+ unsigned int hash
+ = msymbol_hash (SYMBOL_LINKAGE_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
+
+ for (objf = object_files; objf; objf = objf->next)
+ for (tsym = objf->msymbol_hash[hash]; tsym; tsym = tsym->hash_next)
+ if (tsym == sym)
+ return objf;
+
+ /* We should always be able to find the objfile ... */
+ internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
+}
+
+
/* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME. If OBJF is non-NULL, limit
the search to that objfile. If SFILE is non-NULL, the only file-scope