introduce minimal_symbol_upper_bound

This introduces minimal_symbol_upper_bound and changes various bits of
code to use it.  Since this function is intimately tied to the
implementation of minimal symbol tables, I believe it belongs in
minsyms.c.

The new function is extracted from find_pc_partial_function_gnu_ifunc.
This isn't a "clean" move because the old function interleaved the
caching and the computation; but this doesn't make sense for the new
code.

2014-02-26  Tom Tromey  <tromey@redhat.com>

	* blockframe.c (find_pc_partial_function_gnu_ifunc): Use
	bound minimal symbols.  Move code that knows about minsym
	table layout...
	* minsyms.c (minimal_symbol_upper_bound): ... here.  New
	function.
	* minsyms.h (minimal_symbol_upper_bound): Declare.
	* objc-lang.c (find_objc_msgsend): Use bound minimal symbols,
	minimal_symbol_upper_bound.
This commit is contained in:
Tom Tromey
2013-08-19 07:58:44 -06:00
parent 1b58801583
commit 50e65b1713
5 changed files with 83 additions and 51 deletions

View File

@ -249,4 +249,12 @@ void iterate_over_minimal_symbols (struct objfile *objf,
void *),
void *user_data);
/* Compute the upper bound of MINSYM. The upper bound is the last
address thought to be part of the symbol. If the symbol has a
size, it is used. Otherwise use the lesser of the next minimal
symbol in the same section, or the end of the section, as the end
of the function. */
CORE_ADDR minimal_symbol_upper_bound (struct bound_minimal_symbol minsym);
#endif /* MINSYMS_H */