2004-02-09 Andrew Cagney <cagney@redhat.com>

* blockframe.c (find_pc_partial_function): If find_pc_overlay
	fails, try find_pc_section.  Fix PR c++/1267.
	* minsyms.c (lookup_minimal_symbol_by_pc): Use find_pc_section
	instead of find_pc_mapped_section.
	(lookup_minimal_symbol_by_pc_section): If the SECTION is NULL, do
	not default to the section containing PC.  Fix PR symtab/1519.
This commit is contained in:
Andrew Cagney 2004-02-09 19:13:46 +00:00
parent f380691611
commit 43b54b88e7
3 changed files with 47 additions and 15 deletions

View file

@ -507,10 +507,24 @@ int
find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
CORE_ADDR *endaddr)
{
asection *section;
struct bfd_section *bfd_section;
section = find_pc_overlay (pc);
return find_pc_sect_partial_function (pc, section, name, address, endaddr);
/* To ensure that the symbol returned belongs to the correct setion
(and that the last [random] symbol from the previous section
isn't returned) try to find the section containing PC. First try
the overlay code (which by default returns NULL); and second try
the normal section code (which almost always succeeds). */
bfd_section = find_pc_overlay (pc);
if (bfd_section == NULL)
{
struct obj_section *obj_section = find_pc_section (pc);
if (obj_section == NULL)
bfd_section = NULL;
else
bfd_section = obj_section->the_bfd_section;
}
return find_pc_sect_partial_function (pc, bfd_section, name, address,
endaddr);
}
/* Return the innermost stack frame executing inside of BLOCK,