Add section table to objfile struct. Use it for find_pc_section.
* objfiles.c (add_to_objfile_sections, build_objfile_section_table, find_pc_section): new functions. (allocate_objfile): build section table. * objfiles.h (struct obj_section): new structure. (struct objfile): add section table. (find_pc_section): new prototype. * solib.[ch] (find_pc_section_from_so_list): removed. * sparc-tdep.c: include objfiles.h for find_pc_section. include symfile.h for objfiles.h. (in_solib_trampoline): adjusted for new find_pc_section prototype. Removed BAD_RICH_HACK ifdefs. * symfile.c (syms_from_objfile): offset objfile sections. (find_pc_section): removed. Also removed BAD_RICH_HACK ifdefs. * symfile.h (find_pc_section): prototype removed. Also fixed comment typo NUL -> NULL. * target.[ch] (find_pc_section_from_targets): removed. * config/sparc/tm-sun4sol2.h (BAD_RICHH_HACK): removed.
This commit is contained in:
parent
07861607f5
commit
73d0fc7820
6 changed files with 118 additions and 28 deletions
|
@ -114,6 +114,18 @@ struct entry_info
|
|||
};
|
||||
|
||||
|
||||
/* This structure is used to map pc values into sections. Note that
|
||||
offset is currently target independent and is redundant to the
|
||||
section_offsets field in the objfile struct. FIXME. */
|
||||
|
||||
struct obj_section {
|
||||
CORE_ADDR addr; /* lowest address in section */
|
||||
CORE_ADDR endaddr; /* 1+highest address in section */
|
||||
CORE_ADDR offset; /* offset between (end)addr and actual
|
||||
memory addresses. */
|
||||
sec_ptr sec_ptr; /* BFD section pointer */
|
||||
};
|
||||
|
||||
/* Master structure for keeping track of each input file from which
|
||||
gdb reads symbols. One of these is allocated for each such file we
|
||||
access, e.g. the exec_file, symbol_file, and any shared library object
|
||||
|
@ -257,6 +269,14 @@ struct objfile
|
|||
|
||||
struct section_offsets *section_offsets;
|
||||
int num_sections;
|
||||
|
||||
/* set of section begin and end addresses used to map pc addresses
|
||||
into sections. Currently on the psymbol_obstack (which makes no
|
||||
sense, but I'm not sure it's harming anything). */
|
||||
|
||||
struct obj_section
|
||||
*sections,
|
||||
*sections_end;
|
||||
};
|
||||
|
||||
/* Defines for the objfile flag word. */
|
||||
|
@ -333,6 +353,8 @@ have_full_symbols PARAMS ((void));
|
|||
extern int
|
||||
have_minimal_symbols PARAMS ((void));
|
||||
|
||||
extern sec_ptr
|
||||
find_pc_section PARAMS((CORE_ADDR pc));
|
||||
|
||||
/* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete
|
||||
the objfile during the traversal. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue