* objfiles.h (obj_section), objfiles.c (build_objfile_section_table):

Add objfile field.
	* objfiles.c (find_pc_section): Return a struct obj_section *.
	* sparc-tdep.c (in_solib_trampoline): Deal with find_pc_section return.
	* symfile.c (syms_from_objfile) [IBM6000_TARGET]:
	Don't use obj_section hack.
	* xcoffexec (vmap_symtab): Relocate obj_sections.
	* printcmd.c (containing_function_bounds): Use find_pc_section.
This commit is contained in:
Jim Kingdon
1993-04-22 20:42:37 +00:00
parent 87fe2d9df2
commit 4365c36c9b
7 changed files with 110 additions and 25 deletions

View File

@@ -31,6 +31,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "breakpoint.h"
#include "demangle.h"
/* These are just for containing_function_bounds. It might be better
to move containing_function_bounds to blockframe.c or thereabouts. */
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@@ -1846,18 +1852,28 @@ static int
containing_function_bounds (pc, low, high)
CORE_ADDR pc, *low, *high;
{
int scan;
CORE_ADDR scan;
CORE_ADDR limit;
struct obj_section *sec;
if (!find_pc_partial_function (pc, 0, low))
return 0;
sec = find_pc_section (pc);
if (sec == NULL)
return 0;
limit = sec->endaddr;
scan = *low;
do {
scan++;
if (!find_pc_partial_function (scan, 0, high))
return 0;
} while (*low == *high);
while (scan < limit)
{
++scan;
if (!find_pc_partial_function (scan, 0, high))
return 0;
if (*low != *high)
return 1;
}
*high = limit;
return 1;
}