From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: [obish] Eliminate find_pc_sect_partial_function
Date: Fri, 19 Mar 2004 00:09:00 -0000 [thread overview]
Message-ID: <40576351.3060702@gnu.org> (raw)
Message-ID: <20040319000900.dgQjafUU2mHEVe_t78BBRug0zhuakW_7LC39WFUdRXc@z> (raw)
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
Hello,
It turned out that the exported function find_pc_sect_partial_function
was never called outside of blockframe.c (and there only by
find_pc_partial_function). This patch eliminates
find_pc_sect_partial_function folding it into find_pc_partial_function.
committed,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3298 bytes --]
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.
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.92
diff -u -r1.92 blockframe.c
--- blockframe.c 16 Feb 2004 21:49:21 -0000 1.92
+++ blockframe.c 16 Mar 2004 20:24:46 -0000
@@ -343,10 +343,13 @@
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 @@
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
@@ -505,32 +523,6 @@
}
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,
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.88
diff -u -r1.88 symtab.h
--- symtab.h 17 Feb 2004 15:21:22 -0000 1.88
+++ symtab.h 16 Mar 2004 20:24:46 -0000
@@ -1067,9 +1067,6 @@
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 */
next reply other threads:[~2004-03-16 20:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-16 20:28 Andrew Cagney [this message]
2004-03-19 0:09 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40576351.3060702@gnu.org \
--to=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox