+2009-09-14 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ *minsyms.c (lookup_minimal_symbol_by_pc_section_1): Assert non-NULL
+ section.
+ (lookup_minimal_symbol_by_pc_section): Check for NULL section.
+ (lookup_minimal_symbol_by_pc): Adjust.
+
2009-09-14 Paul Pluzhnikov <ppluzhnikov@google.com>
* objfiles.c (qsort_cmp): Remove asserts.
(insert_section_p, filter_debuginfo_sections): New function.
(filter_overlapping_sections): Likewise.
(update_section_map): Adjust.
-
+
2009-09-13 Daniel Jacobowitz <dan@codesourcery.com>
* frame.c (get_frame_id): Default to outer_frame_id if the this_id
/* Search through the minimal symbol table for each objfile and find
the symbol whose address is the largest address that is still less
- than or equal to PC, and matches SECTION (if non-NULL). Returns a
- pointer to the minimal symbol if such a symbol is found, or NULL if
- PC is not in a suitable range. Note that we need to look through
- ALL the minimal symbol tables before deciding on the symbol that
- comes closest to the specified PC. This is because objfiles can
- overlap, for example objfile A has .text at 0x100 and .data at
- 0x40000 and objfile B has .text at 0x234 and .data at 0x40048.
+ than or equal to PC, and matches SECTION (which is not NULL).
+ Returns a pointer to the minimal symbol if such a symbol is found,
+ or NULL if PC is not in a suitable range.
+ Note that we need to look through ALL the minimal symbol tables
+ before deciding on the symbol that comes closest to the specified PC.
+ This is because objfiles can overlap, for example objfile A has .text
+ at 0x100 and .data at 0x40000 and objfile B has .text at 0x234 and
+ .data at 0x40048.
If WANT_TRAMPOLINE is set, prefer mst_solib_trampoline symbols when
there are text and trampoline symbols at the same address.
struct objfile *objfile;
struct minimal_symbol *msymbol;
struct minimal_symbol *best_symbol = NULL;
- struct obj_section *pc_section;
enum minimal_symbol_type want_type, other_type;
want_type = want_trampoline ? mst_solib_trampoline : mst_text;
other_type = want_trampoline ? mst_text : mst_solib_trampoline;
-
- /* PC has to be in a known section. This ensures that anything
- beyond the end of the last segment doesn't appear to be part of
- the last function in the last segment. */
- pc_section = find_pc_section (pc);
- if (pc_section == NULL)
- return NULL;
- /* We can not require the symbol found to be in pc_section, because
+ /* We can not require the symbol found to be in section, because
e.g. IRIX 6.5 mdebug relies on this code returning an absolute
symbol - but find_pc_section won't return an absolute section and
hence the code below would skip over absolute symbols. We can
files, search both the file and its separate debug file. There's
no telling which one will have the minimal symbols. */
- objfile = pc_section->objfile;
+ gdb_assert (section != NULL);
+ objfile = section->objfile;
if (objfile->separate_debug_objfile)
objfile = objfile->separate_debug_objfile;
struct minimal_symbol *
lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, struct obj_section *section)
{
+ if (section == NULL)
+ {
+ /* NOTE: cagney/2004-01-27: This was using find_pc_mapped_section to
+ force the section but that (well unless you're doing overlay
+ debugging) always returns NULL making the call somewhat useless. */
+ section = find_pc_section (pc);
+ if (section == NULL)
+ return NULL;
+ }
return lookup_minimal_symbol_by_pc_section_1 (pc, section, 0);
}
struct minimal_symbol *
lookup_minimal_symbol_by_pc (CORE_ADDR pc)
{
- /* NOTE: cagney/2004-01-27: This was using find_pc_mapped_section to
- force the section but that (well unless you're doing overlay
- debugging) always returns NULL making the call somewhat useless. */
- struct obj_section *section = find_pc_section (pc);
- if (section == NULL)
- return NULL;
- return lookup_minimal_symbol_by_pc_section (pc, section);
+ return lookup_minimal_symbol_by_pc_section (pc, NULL);
}
\f