From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31326 invoked by alias); 16 Mar 2004 20:28:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31275 invoked from network); 16 Mar 2004 20:28:03 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 16 Mar 2004 20:28:03 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1C65B2B92; Tue, 16 Mar 2004 15:28:01 -0500 (EST) Message-ID: <40576351.3060702@gnu.org> Date: Fri, 19 Mar 2004 00:09:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [obish] Eliminate find_pc_sect_partial_function Content-Type: multipart/mixed; boundary="------------090807040308070605080904" X-SW-Source: 2004-03/txt/msg00363.txt.bz2 Message-ID: <20040319000900.dgQjafUU2mHEVe_t78BBRug0zhuakW_7LC39WFUdRXc@z> This is a multi-part message in MIME format. --------------090807040308070605080904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 283 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 --------------090807040308070605080904 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 3298 2004-03-16 Andrew Cagney * 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 */ --------------090807040308070605080904--