summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-03-16 20:25:24 +0000
committerAndrew Cagney <cagney@redhat.com>2004-03-16 20:25:24 +0000
commita864c203ff1a4b4ad21ee73e86a3ef95a2764782 (patch)
treef31ce9c89796604925256f0762389304e5d76ec8 /gdb
parent79e597784ef0478cfe5e63a2808ac659a5a6a750 (diff)
downloadgdb-a864c203ff1a4b4ad21ee73e86a3ef95a2764782.tar.gz
2004-03-16 Andrew Cagney <cagney@redhat.com>
* symtab.h (find_pc_sect_partial_function): Delete declaration. * blockframe.c (find_pc_partial_function) (find_pc_sect_partial_function): Merge into a single find_pc_partial_function.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/blockframe.c48
-rw-r--r--gdb/symtab.h3
3 files changed, 27 insertions, 31 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2dd7f3358f9..7a0008e95b4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-16 Andrew Cagney <cagney@redhat.com>
+
+ * symtab.h (find_pc_sect_partial_function): Delete declaration.
+ * blockframe.c (find_pc_partial_function)
+ (find_pc_sect_partial_function): Merge into a single
+ find_pc_partial_function.
+
2004-03-16 Mark Kettenis <kettenis@gnu.org>
* i386bsd-nat.c: s/regno/regnum/g.
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 265bd2e82f1..1e965550546 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -343,10 +343,13 @@ clear_pc_function_cache (void)
If it fails, it sets *NAME, *ADDRESS, and *ENDADDR to zero and
returns 0. */
+/* Backward compatibility, no section argument. */
+
int
-find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
- CORE_ADDR *address, CORE_ADDR *endaddr)
+find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
+ CORE_ADDR *endaddr)
{
+ struct bfd_section *section;
struct partial_symtab *pst;
struct symbol *f;
struct minimal_symbol *msymbol;
@@ -355,6 +358,21 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
int i;
CORE_ADDR mapped_pc;
+ /* 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). */
+ section = find_pc_overlay (pc);
+ if (section == NULL)
+ {
+ struct obj_section *obj_section = find_pc_section (pc);
+ if (obj_section == NULL)
+ section = NULL;
+ else
+ section = obj_section->the_bfd_section;
+ }
+
mapped_pc = overlay_mapped_address (pc, section);
if (mapped_pc >= cache_pc_function_low
@@ -507,32 +525,6 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
return 1;
}
-/* Backward compatibility, no section argument. */
-
-int
-find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
- CORE_ADDR *endaddr)
-{
- struct bfd_section *bfd_section;
-
- /* 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,
or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 5a6c3984bd1..16a212eff1e 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1067,9 +1067,6 @@ extern int find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *,
extern void clear_pc_function_cache (void);
-extern int find_pc_sect_partial_function (CORE_ADDR, asection *,
- char **, CORE_ADDR *, CORE_ADDR *);
-
/* from symtab.c: */
/* lookup partial symbol table by filename */