diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-05-03 00:37:35 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2008-05-03 00:37:35 +0000 |
commit | bccdca4a5f7b9879d67a35d78063a9ac3b5f5104 (patch) | |
tree | 6f5c583a8507dcac9b3a08aa00929c6c123af41a /gdb/minsyms.c | |
parent | 0315afbc1dfcbdd1af230eb7b6d5193634bc254a (diff) | |
download | gdb-bccdca4a5f7b9879d67a35d78063a9ac3b5f5104.zip gdb-bccdca4a5f7b9879d67a35d78063a9ac3b5f5104.tar.gz gdb-bccdca4a5f7b9879d67a35d78063a9ac3b5f5104.tar.bz2 |
* 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.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 1d0ae6c..8dceb0d 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 |