Index: minsyms.c =================================================================== RCS file: /cvs/src/src/gdb/minsyms.c,v retrieving revision 1.66 diff -u -p -u -r1.66 minsyms.c --- minsyms.c 28 Jun 2009 00:20:22 -0000 1.66 +++ minsyms.c 22 Aug 2009 18:01:37 -0000 @@ -457,18 +457,10 @@ lookup_minimal_symbol_by_pc_section_1 (C 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 e.g. IRIX 6.5 mdebug relies on this code returning an absolute @@ -479,7 +471,7 @@ lookup_minimal_symbol_by_pc_section_1 (C 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; + objfile = section->objfile; if (objfile->separate_debug_objfile) objfile = objfile->separate_debug_objfile; @@ -680,6 +672,12 @@ lookup_minimal_symbol_by_pc_section_1 (C struct minimal_symbol * lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, struct obj_section *section) { + if (section == NULL) + { + section = find_pc_section (pc); + if (section == NULL) + return NULL; + } return lookup_minimal_symbol_by_pc_section_1 (pc, section, 0); } @@ -695,7 +693,7 @@ lookup_minimal_symbol_by_pc (CORE_ADDR p 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_1 (pc, section, 0); }